Skip to main content

CustomValue

Trait CustomValue 

Source
pub trait CustomValue {
    // Provided methods
    fn as_str(&self) -> Option<&str> { ... }
    fn as_number(&self) -> Option<Number> { ... }
    fn as_any(&self) -> Option<&dyn Any> { ... }
    fn as_date_time(&self) -> Option<DateTime<'_>> { ... }
    fn as_measure(&self) -> Option<Measure<'_>> { ... }
}
Expand description

An application’s own argument type: what it converts to.

Provided Methods§

Source

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

Its string form (unannotated placeholders, :string).

Source

fn as_number(&self) -> Option<Number>

Its numeric value (numeric operands).

Source

fn as_any(&self) -> Option<&dyn Any>

Itself, for handlers that know the concrete type.

Source

fn as_date_time(&self) -> Option<DateTime<'_>>

Its date/time value (date/time operands, datetime.md).

Source

fn as_measure(&self) -> Option<Measure<'_>>

Its number with a currency or a unit (:currency and :unit operands, number.md; a numeric operand for the other numeric functions).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§