pub enum Property<Key = String> {
    String(Key, String),
    Bytes(Key, Vec<u8>),
    Int(Key, i64),
    Uint(Key, u64),
    Double(Key, f64),
    Bool(Key, bool),
    DoubleArray(Key, ArrayContent<f64>),
    IntArray(Key, ArrayContent<i64>),
    UintArray(Key, ArrayContent<u64>),
    StringList(Key, Vec<String>),
}Expand description
A named property. Each of the fields consists of (name, value).
Key is the type of the property’s name and is typically a string. In cases where there are well known, common property names, an alternative may be used to reduce copies of the name.
Variants§
String(Key, String)
The value is a string.
Bytes(Key, Vec<u8>)
The value is a bytes vector.
Int(Key, i64)
The value is an integer.
Uint(Key, u64)
The value is an unsigned integer.
Double(Key, f64)
The value is a double.
Bool(Key, bool)
The value is a boolean.
DoubleArray(Key, ArrayContent<f64>)
The value is a double array.
IntArray(Key, ArrayContent<i64>)
The value is an integer array.
UintArray(Key, ArrayContent<u64>)
The value is an unsigned integer array.
StringList(Key, Vec<String>)
The value is a list of strings.
Implementations§
Source§impl<Key> Property<Key>
 
impl<Key> Property<Key>
Sourcepub fn int(&self) -> Option<i64>
 
pub fn int(&self) -> Option<i64>
Returns the Int value or None if the property isn’t of that type
Sourcepub fn uint(&self) -> Option<u64>
 
pub fn uint(&self) -> Option<u64>
Returns the Uint value or None if the property isn’t of that type
Source§impl<Key> Property<Key>
 
impl<Key> Property<Key>
Sourcepub fn string(&self) -> Option<&str>
 
pub fn string(&self) -> Option<&str>
Returns the String value or None if the property isn’t of that type
Sourcepub fn bytes(&self) -> Option<&[u8]>
 
pub fn bytes(&self) -> Option<&[u8]>
Returns the Bytes value or None if the property isn’t of that type
Sourcepub fn double_array(&self) -> Option<&ArrayContent<f64>>
 
pub fn double_array(&self) -> Option<&ArrayContent<f64>>
Returns the DoubleArray value or None if the property isn’t of that type
Sourcepub fn int_array(&self) -> Option<&ArrayContent<i64>>
 
pub fn int_array(&self) -> Option<&ArrayContent<i64>>
Returns the IntArray value or None if the property isn’t of that type
Sourcepub fn uint_array(&self) -> Option<&ArrayContent<u64>>
 
pub fn uint_array(&self) -> Option<&ArrayContent<u64>>
Returns the UintArray value or None if the property isn’t of that type
Sourcepub fn string_list(&self) -> Option<&[String]>
 
pub fn string_list(&self) -> Option<&[String]>
Returns the StringList value or None if the property isn’t of that type
Source§impl<K> Property<K>
 
impl<K> Property<K>
Sourcepub fn discriminant_name(&self) -> &'static str
 
pub fn discriminant_name(&self) -> &'static str
Returns a string indicating which variant of property this is, useful for printing debug values.
Sourcepub fn number_as_int(&self) -> Option<i64>
 
pub fn number_as_int(&self) -> Option<i64>
Return a a numeric property as a signed integer. Useful for having a single function to call when a property has been passed through JSON, potentially losing its original signedness.
Note: unsigned integers larger than isize::MAX will be returned as None. If you expect
values that high, consider calling Property::int() and Property::uint() directly.
Trait Implementations§
impl<Key> StructuralPartialEq for Property<Key>
Auto Trait Implementations§
impl<Key> Freeze for Property<Key>where
    Key: Freeze,
impl<Key> RefUnwindSafe for Property<Key>where
    Key: RefUnwindSafe,
impl<Key> Send for Property<Key>where
    Key: Send,
impl<Key> Sync for Property<Key>where
    Key: Sync,
impl<Key> Unpin for Property<Key>where
    Key: Unpin,
impl<Key> UnwindSafe for Property<Key>where
    Key: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
    D: ResourceDialect,
 
impl<T, D> Encode<Ambiguous1, D> for Twhere
    D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
    D: ResourceDialect,
 
impl<T, D> Encode<Ambiguous2, D> for Twhere
    D: ResourceDialect,
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more