MCPcopy Create free account
hub / github.com/IntegralPilot/rustc_codegen_jvm / Calculator

Interface Calculator

tests/binary/traits/src/main.rs:1–13  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1trait Calculator {
2 // Performs a primary calculation
3 fn calculate(&self, a: i32, b: i32) -> i32;
4
5 // Modifies internal state based on input
6 fn accumulate(&mut self, value: i32);
7
8 // Returns the current internal state
9 fn get_value(&self) -> i32;
10
11 // Returns an identifier for the calculator type
12 fn id(&self) -> u8;
13}
14
15trait CarrierValue {
16 fn carrier_value(self) -> i32;

Callers

nothing calls this directly

Implementers 1

main.rstests/binary/traits/src/main.rs

Calls

no outgoing calls

Tested by

no test coverage detected