Struct saltpig::extensions::cbor::EncodedCbor[][src]

pub struct EncodedCbor(_);

An extension type for embedded encoded CBOR items (tag value 24; RFC 7049, section 2.4.4.1).

(Note that this is really just a newtype of Vec<u8>, and no checking at all is done to see if the wrapped bytes even remotely resemble an encoded CBOR item.)

Methods

impl EncodedCbor
[src]

Constructs an EncodedCbor from the raw bytes it wraps.

As mentioned in the type-level docs, no checking is done to see if the bytes are actually valid CBOR data.

Attempts to parse an EncodedCbor value out of a Value (returning Err if the value turns out to be something other than an EncodedCbor).

Constructs an EncodedCbor by encoding a Value.

Unwraps this EncodedCbor, returning the underlying bytes.

Renders self into a generic CBOR value.

Returns a Value representing self's encoded bytes with a tag value of 24.

Attempts to decode the encoded CBOR item.

This is a convenience method that simply calls Value::from_bytes() on the underlying bytes stored in self.

Trait Implementations

impl Debug for EncodedCbor
[src]

Formats the value using the given formatter. Read more

impl Clone for EncodedCbor
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Extension for EncodedCbor
[src]

TAG: u64 = 24

The tag value belonging to this extension type.

impl From<EncodedCbor> for Value
[src]

Renders self into a generic CBOR value.

Equivalent to EncodedCbor::embed().

Performs the conversion.

impl TryFrom<Value> for EncodedCbor
[src]

Attempts to parse an EncodedCbor value out of a Value.

Equivalent to EncodedCbor::extract().

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Constructs an EncodedCbor from the raw bytes it wraps.

Equivalent to EncodedCbor::new().

Performs the conversion.

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

Unwraps this EncodedCbor, returning the underlying bytes.

Equivalent to EncodedCbor::into_inner()

Performs the conversion.

Auto Trait Implementations

impl Send for EncodedCbor

impl Sync for EncodedCbor