Skip to main content

ValueLike

Trait ValueLike 

Source
pub trait ValueLike {
    // Required methods
    fn as_float(&self) -> Option<f64>;
    fn as_str(&self) -> Option<Cow<'_, str>>;
}
Expand description

A trait for extracting typed values from attribute values.

Provides methods for converting attribute values to common types used in sampling logic.

Required Methods§

Source

fn as_float(&self) -> Option<f64>

Returns the value as f64, if representable as a float.

Source

fn as_str(&self) -> Option<Cow<'_, str>>

Returns the value as a string, if representable.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§