pub enum AttributeValue {
String(String),
Array(Vec<AttributeValue, Global>),
Number(f64),
Bool(bool),
Object(HashMap<String, AttributeValue, RandomState>),
Null,
}
Expand description
AttributeValue is an enum representing possible values that can be stored in a user attribute.
Variants
String(String)
Used when storing a string value.
Array(Vec<AttributeValue, Global>)
Used when storing an array of AttributeValues.
Number(f64)
Used when storing a number.
Bool(bool)
Used when storing a boolean.
Object(HashMap<String, AttributeValue, RandomState>)
Used when storing a complex map of values.
Null
Used to represent a null value.
Implementations
Returns None unless self is a String. It will not convert.
Returns the wrapped value as a float for numeric types, and None otherwise.
Attempt to convert any of the following into a chrono::DateTime in UTC:
- RFC3339/ISO8601 timestamp (example: “2016-04-16T17:09:12.759-07:00”)
- Unix epoch milliseconds as number It will return None if the conversion fails or if no conversion is possible.
Attempt to parse a string attribute into a semver version.
It will return None if it cannot parse it, or for non-string attributes.
Find the AttributeValue based off the provided predicate p
.
Trait Implementations
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<AttributeValue, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<AttributeValue, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
impl<S, T> From<HashMap<S, T, RandomState>> for AttributeValue where
String: From<S>,
AttributeValue: From<T>,
impl<S, T> From<HashMap<S, T, RandomState>> for AttributeValue where
String: From<S>,
AttributeValue: From<T>,
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
impl<S, T> FromIterator<(S, T)> for AttributeValue where
String: From<S>,
AttributeValue: From<T>,
impl<S, T> FromIterator<(S, T)> for AttributeValue where
String: From<S>,
AttributeValue: From<T>,
Creates a value from an iterator. Read more
Creates a value from an iterator. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for AttributeValue
impl Send for AttributeValue
impl Sync for AttributeValue
impl Unpin for AttributeValue
impl UnwindSafe for AttributeValue
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more