Enum serde_cbor::ObjectKey
[−]
[src]
A simplified CBOR value containing only types useful for keys.
Variants
Integer(i64)
An integer.
Bytes(Vec<u8>)
A byte string.
String(String)
An UTF-8 string.
Bool(bool)
A boolean value.
Null
No value.
Methods
impl ObjectKey
[src]
impl ObjectKey
pub fn is_bytes(&self) -> bool
[src]
pub fn is_bytes(&self) -> bool
Returns true if the ObjectKey is a byte string.
pub fn as_bytes(&self) -> Option<&Vec<u8>>
[src]
pub fn as_bytes(&self) -> Option<&Vec<u8>>
Returns the associated byte string or None
if the ObjectKey has a different type.
pub fn as_bytes_mut(&mut self) -> Option<&mut Vec<u8>>
[src]
pub fn as_bytes_mut(&mut self) -> Option<&mut Vec<u8>>
Returns the associated mutable byte string or None
if the ObjectKey has a different type.
pub fn is_string(&self) -> bool
[src]
pub fn is_string(&self) -> bool
Returns true if the ObjectKey is a string.
pub fn as_string(&self) -> Option<&String>
[src]
pub fn as_string(&self) -> Option<&String>
Returns the associated string or None
if the *ObjectKey` has a different type.
pub fn as_string_mut(&mut self) -> Option<&mut String>
[src]
pub fn as_string_mut(&mut self) -> Option<&mut String>
Returns the associated mutable string or None
if the ObjectKey
has a different type.
pub fn is_number(&self) -> bool
[src]
pub fn is_number(&self) -> bool
Retrns true if the ObjectKey
is a number.
pub fn as_i64(&self) -> Option<i64>
[src]
pub fn as_i64(&self) -> Option<i64>
If the ObjectKey
is a number, return or cast it to a i64. Returns None otherwise.
pub fn as_u64(&self) -> Option<u64>
[src]
pub fn as_u64(&self) -> Option<u64>
If the ObjectKey
is a number, return or cast it to a u64. Returns None otherwise.
pub fn is_boolean(&self) -> bool
[src]
pub fn is_boolean(&self) -> bool
Returns true if the ObjectKey is a boolean.
pub fn as_boolean(&self) -> Option<bool>
[src]
pub fn as_boolean(&self) -> Option<bool>
If the ObjectKey is a Boolean, returns the associated bool. Returns None otherwise.
pub fn is_null(&self) -> bool
[src]
pub fn is_null(&self) -> bool
Returns true if the ObjectKey is a Null. Returns false otherwise.
pub fn as_null(&self) -> Option<()>
[src]
pub fn as_null(&self) -> Option<()>
If the ObjectKey is a Null, returns (). Returns None otherwise.
Trait Implementations
impl Clone for ObjectKey
[src]
impl Clone for ObjectKey
fn clone(&self) -> ObjectKey
[src]
fn clone(&self) -> ObjectKey
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for ObjectKey
[src]
impl Debug for ObjectKey
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for ObjectKey
[src]
impl PartialEq for ObjectKey
fn eq(&self, __arg_0: &ObjectKey) -> bool
[src]
fn eq(&self, __arg_0: &ObjectKey) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ObjectKey) -> bool
[src]
fn ne(&self, __arg_0: &ObjectKey) -> bool
This method tests for !=
.
impl Eq for ObjectKey
[src]
impl Eq for ObjectKey
impl PartialOrd for ObjectKey
[src]
impl PartialOrd for ObjectKey
fn partial_cmp(&self, __arg_0: &ObjectKey) -> Option<Ordering>
[src]
fn partial_cmp(&self, __arg_0: &ObjectKey) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &ObjectKey) -> bool
[src]
fn lt(&self, __arg_0: &ObjectKey) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &ObjectKey) -> bool
[src]
fn le(&self, __arg_0: &ObjectKey) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &ObjectKey) -> bool
[src]
fn gt(&self, __arg_0: &ObjectKey) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &ObjectKey) -> bool
[src]
fn ge(&self, __arg_0: &ObjectKey) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for ObjectKey
[src]
impl Ord for ObjectKey
fn cmp(&self, __arg_0: &ObjectKey) -> Ordering
[src]
fn cmp(&self, __arg_0: &ObjectKey) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Hash for ObjectKey
[src]
impl Hash for ObjectKey
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<'de> Deserialize<'de> for ObjectKey
[src]
impl<'de> Deserialize<'de> for ObjectKey
fn deserialize<D>(deserializer: D) -> Result<ObjectKey, D::Error> where
D: Deserializer<'de>,
[src]
fn deserialize<D>(deserializer: D) -> Result<ObjectKey, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Serialize for ObjectKey
[src]
impl Serialize for ObjectKey
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl From<ObjectKey> for Value
[src]
impl From<ObjectKey> for Value
impl From<Value> for ObjectKey
[src]
impl From<Value> for ObjectKey
impl From<i64> for ObjectKey
[src]
impl From<i64> for ObjectKey
impl From<Vec<u8>> for ObjectKey
[src]
impl From<Vec<u8>> for ObjectKey
impl From<String> for ObjectKey
[src]
impl From<String> for ObjectKey
impl From<bool> for ObjectKey
[src]
impl From<bool> for ObjectKey