Struct saltpig::extensions::cbor::Ident [−][src]
pub struct Ident(pub Value);
An extension type for self-describing CBOR items (tag value 55799; RFC 7049, section 2.4.5).
Methods
impl Ident
[src]
impl Ident
pub fn extract(value: Value) -> Result<Ident, TypeError>
[src]
pub fn extract(value: Value) -> Result<Ident, TypeError>
Attempts to parse an Ident
value out of a Value
(returning Err
if the value turns out to be something other than an Ident
).
pub fn embed(self) -> Value
[src]
pub fn embed(self) -> Value
Renders self
into a generic CBOR value.
Returns a Value
representing self
's encoded bytes with a tag value
of 55799.
Trait Implementations
impl Debug for Ident
[src]
impl Debug for Ident
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Ident
[src]
impl Clone for Ident
fn clone(&self) -> Ident
[src]
fn clone(&self) -> Ident
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)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Extension for Ident
[src]
impl Extension for Ident
impl From<Ident> for Value
[src]
impl From<Ident> for Value
Renders self
into a generic CBOR value.
Equivalent to Ident::embed()
.
impl TryFrom<Value> for Ident
[src]
impl TryFrom<Value> for Ident
Attempts to parse an Ident
value out of a Value
.
Equivalent to Ident::extract()
.