Enum serde_cbor::ObjectKey[][src]

pub enum ObjectKey {
    Integer(i64),
    Bytes(Vec<u8>),
    String(String),
    Bool(bool),
    Null,
}

A simplified CBOR value containing only types useful for keys.

Variants

An integer.

A byte string.

An UTF-8 string.

A boolean value.

No value.

Methods

impl ObjectKey
[src]

Returns true if the ObjectKey is a byte string.

Returns the associated byte string or None if the ObjectKey has a different type.

Returns the associated mutable byte string or None if the ObjectKey has a different type.

Returns true if the ObjectKey is a string.

Returns the associated string or None if the *ObjectKey` has a different type.

Returns the associated mutable string or None if the ObjectKey has a different type.

Retrns true if the ObjectKey is a number.

If the ObjectKey is a number, return or cast it to a i64. Returns None otherwise.

If the ObjectKey is a number, return or cast it to a u64. Returns None otherwise.

Returns true if the ObjectKey is a boolean.

If the ObjectKey is a Boolean, returns the associated bool. Returns None otherwise.

Returns true if the ObjectKey is a Null. Returns false otherwise.

If the ObjectKey is a Null, returns (). Returns None otherwise.

Trait Implementations

impl Clone for ObjectKey
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for ObjectKey
[src]

Formats the value using the given formatter. Read more

impl PartialEq for ObjectKey
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for ObjectKey
[src]

impl PartialOrd for ObjectKey
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

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]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl Hash for ObjectKey
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<'de> Deserialize<'de> for ObjectKey
[src]

Deserialize this value from the given Serde deserializer. Read more

impl Serialize for ObjectKey
[src]

Serialize this value into the given Serde serializer. Read more

impl From<ObjectKey> for Value
[src]

Performs the conversion.

impl From<Value> for ObjectKey
[src]

Performs the conversion.

impl From<i64> for ObjectKey
[src]

Performs the conversion.

impl From<Vec<u8>> for ObjectKey
[src]

Performs the conversion.

impl From<String> for ObjectKey
[src]

Performs the conversion.

impl From<bool> for ObjectKey
[src]

Performs the conversion.

Auto Trait Implementations

impl Send for ObjectKey

impl Sync for ObjectKey