pub trait AttributeValueExt {
// Required methods
fn as_string(&self) -> Option<&MetaString>;
fn as_float(&self) -> Option<f64>;
fn as_bool(&self) -> Option<bool>;
fn as_int(&self) -> Option<i64>;
fn as_num(&self) -> Option<f64>;
fn as_bytes(&self) -> Option<&[u8]>;
}Expand description
Saluki’s accessors for AttributeValue.
AttributeValue is a type alias for a generic type from another crate, so these accessors are on a trait. Import
the trait to call them.
Required Methods§
Sourcefn as_string(&self) -> Option<&MetaString>
fn as_string(&self) -> Option<&MetaString>
Returns the inner string if this is a String variant.
Sourcefn as_float(&self) -> Option<f64>
fn as_float(&self) -> Option<f64>
Returns the inner float if this is a Float variant.
Returns Some only when the stored variant is Float. For numeric semantic tags where the source may store an
integer (for example, sampling priority, _sample_rate, _top_level), use as_num instead.