Skip to main content

OtherValue

Trait OtherValue 

Source
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§

Source

fn type_name(&self) -> &str

The kind’s name as the language writes it.

Source

fn display_string(&self) -> String

How the value prints.

Source

fn as_any(&self) -> &dyn Any

The value, for a kind to recognise one of its own.

Source

fn equals(&self, o: &dyn OtherValue) -> bool

The language’s equality with another value of a kind outside the tower.

Source

fn order(&self, o: &LogosValue) -> Option<Option<Ordering>>

The order of self against o, None when the language orders no such pair.

Source

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.

Implementors§