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]

[src]

Returns true if the ObjectKey is a byte string.

[src]

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

[src]

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

[src]

Returns true if the ObjectKey is a string.

[src]

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

[src]

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

[src]

Retrns true if the ObjectKey is a number.

[src]

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

[src]

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

[src]

Returns true if the ObjectKey is a boolean.

[src]

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

[src]

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

[src]

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

Trait Implementations

impl Clone for ObjectKey
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for ObjectKey
[src]

[src]

Formats the value using the given formatter.

impl PartialEq for ObjectKey
[src]

[src]

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

[src]

This method tests for !=.

impl Eq for ObjectKey
[src]

impl PartialOrd for ObjectKey
[src]

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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]

[src]

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

1.22.0
[src]

Compares and returns the maximum of two values. Read more

1.22.0
[src]

Compares and returns the minimum of two values. Read more

impl Hash for ObjectKey
[src]

[src]

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

1.3.0
[src]

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

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

[src]

Deserialize this value from the given Serde deserializer. Read more

impl Serialize for ObjectKey
[src]

[src]

Serialize this value into the given Serde serializer. Read more

impl From<Value> for ObjectKey
[src]

[src]

Performs the conversion.

impl From<i64> for ObjectKey
[src]

[src]

Performs the conversion.

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

[src]

Performs the conversion.

impl From<String> for ObjectKey
[src]

[src]

Performs the conversion.

impl From<bool> for ObjectKey
[src]

[src]

Performs the conversion.