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§
Sourcefn number_domain(&self, cx: &mut Cx) -> Result<Symbol>
fn number_domain(&self, cx: &mut Cx) -> Result<Symbol>
The number domain this value reports membership in.
Provided Methods§
Sourcefn number_literal(&self, _cx: &mut Cx) -> Result<Option<NumberLiteral>>
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".