pub trait OtherValue:
Debug
+ Send
+ Sync
+ 'static {
// Required methods
fn type_name(&self) -> &str;
fn display_string(&self) -> String;
fn as_any(&self) -> &dyn Any;
fn equals(&self, o: &dyn OtherValue) -> bool;
fn order(&self, o: &LogosValue) -> Option<Option<Ordering>>;
fn combine(
&self,
op: Op,
o: &LogosValue,
reversed: bool,
) -> Option<Result<LogosValue, String>>;
}Expand description
A compiled value of a kind outside the exact tower, as a LogosValue holds it: each answers for
itself how it prints, what it equals, how it orders and what it combines with, exactly as the
interpreter’s value of that kind does. A pair it has no arm for is refused in the interpreter’s
words by the caller.
Required Methods§
Sourcefn display_string(&self) -> String
fn display_string(&self) -> String
How the value prints.
Sourcefn equals(&self, o: &dyn OtherValue) -> bool
fn equals(&self, o: &dyn OtherValue) -> bool
The language’s equality with another value of a kind outside the tower.
Sourcefn order(&self, o: &LogosValue) -> Option<Option<Ordering>>
fn order(&self, o: &LogosValue) -> Option<Option<Ordering>>
The order of self against o, None when the language orders no such pair.
Sourcefn combine(
&self,
op: Op,
o: &LogosValue,
reversed: bool,
) -> Option<Result<LogosValue, String>>
fn combine( &self, op: Op, o: &LogosValue, reversed: bool, ) -> Option<Result<LogosValue, String>>
self op o, or o op self when reversed; None when the language has no arm for the pair.