Skip to main content

NumberValue

Trait NumberValue 

Source
pub trait NumberValue: Send + Sync {
    // Required method
    fn number_domain(&self, cx: &mut Cx) -> Result<Symbol>;

    // Provided method
    fn number_literal(&self, _cx: &mut Cx) -> Result<Option<NumberLiteral>> { ... }
}
Expand description

Protocol for runtime objects that present themselves as numbers.

Required Methods§

Source

fn number_domain(&self, cx: &mut Cx) -> Result<Symbol>

The number domain this value reports membership in.

Provided Methods§

Source

fn number_literal(&self, _cx: &mut Cx) -> Result<Option<NumberLiteral>>

Canonical literal form, or Ok(None) when not representable.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§