Skip to main content

TowerValue

Trait TowerValue 

Source
pub trait TowerValue: Clone + Sized {
Show 21 methods // Required methods fn exact(&self) -> Option<ExactRef<'_, Self>>; fn standard_rational(&self) -> Option<Rational>; fn integer(&self) -> Option<BigInt>; fn exact_rational(&self) -> Option<Rational>; fn is_standard_number(&self) -> bool; fn text(&self) -> Option<&str>; fn type_name(&self) -> String; fn display_string(&self) -> String; fn values_equal(&self, other: &Self) -> bool; fn is_nothing(&self) -> bool; fn from_rational(r: Rational) -> Self; fn from_bigint(b: BigInt) -> Self; fn boolean(b: bool) -> Self; fn nothing() -> Self; fn algebraic(a: Algebraic) -> Self; fn exact_real(x: ExactReal) -> Self; fn hyper(h: HyperValue) -> Self; fn natural(n: NaturalValue) -> Self; fn ordinal(o: Ordinal) -> Self; fn depends(d: DependsValue<Self>) -> Self; fn converging(c: Converging<Self>) -> Self;
}
Expand description

A value model that holds the exact types: how to see a value as one of them or as a standard number, and how to build one. The interpreter’s runtime value and a compiled program’s value each implement it; every operation in this module is generic over it.

Required Methods§

Source

fn exact(&self) -> Option<ExactRef<'_, Self>>

The value as one of the exact types, or None for any other value.

Source

fn standard_rational(&self) -> Option<Rational>

An integer, rational, decimal or finite float as the rational it denotes exactly.

Source

fn integer(&self) -> Option<BigInt>

An Int or big integer.

Source

fn exact_rational(&self) -> Option<Rational>

An integer or a rational: a number held exactly, never a float or a decimal.

Source

fn is_standard_number(&self) -> bool

An integer, rational, decimal or float: its own standard part.

Source

fn text(&self) -> Option<&str>

A Text value’s characters.

Source

fn type_name(&self) -> String

The value’s type as the language names it.

Source

fn display_string(&self) -> String

How the value prints.

Source

fn values_equal(&self, other: &Self) -> bool

The language’s equality on two values.

Source

fn is_nothing(&self) -> bool

Whether the value is nothing.

Source

fn from_rational(r: Rational) -> Self

A rational in its smallest form: an Int when it fits, a big integer, else a rational.

Source

fn from_bigint(b: BigInt) -> Self

An integer in its smallest form.

Source

fn boolean(b: bool) -> Self

Source

fn nothing() -> Self

Source

fn algebraic(a: Algebraic) -> Self

Source

fn exact_real(x: ExactReal) -> Self

Source

fn hyper(h: HyperValue) -> Self

Source

fn natural(n: NaturalValue) -> Self

Source

fn ordinal(o: Ordinal) -> Self

Source

fn depends(d: DependsValue<Self>) -> Self

Source

fn converging(c: Converging<Self>) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§