pub enum Label {
Int(i64),
Text(String),
}
Expand description
A COSE label may be either a signed integer value or a string.
Variants§
Trait Implementations§
source§impl AsCborValue for Label
impl AsCborValue for Label
source§fn from_cbor_value(value: Value) -> Result<Self>
fn from_cbor_value(value: Value) -> Result<Self>
Convert a [
Value
] into an instance of the type.source§fn to_cbor_value(self) -> Result<Value>
fn to_cbor_value(self) -> Result<Value>
Convert the object into a [
Value
], consuming it along the way.source§impl CborSerializable for Label
impl CborSerializable for Label
source§fn from_slice(slice: &[u8]) -> Result<Self>
fn from_slice(slice: &[u8]) -> Result<Self>
Create an object instance from serialized CBOR data in a slice. This method will fail (with
CoseError::ExtraneousData
) if there is additional CBOR data after the object.source§impl Ord for Label
impl Ord for Label
Manual implementation of Ord
to ensure that CBOR canonical ordering is respected.
Note that this uses the ordering given by RFC 8949 section 4.2.1 (lexicographic ordering of encoded form), which is different from the canonical ordering defined in RFC 7049 section 3.9 (where the primary sorting criterion is the length of the encoded form)
source§impl PartialEq<Label> for Label
impl PartialEq<Label> for Label
source§impl PartialOrd<Label> for Label
impl PartialOrd<Label> for Label
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Label
impl StructuralEq for Label
impl StructuralPartialEq for Label
Auto Trait Implementations§
impl RefUnwindSafe for Label
impl Send for Label
impl Sync for Label
impl Unpin for Label
impl UnwindSafe for Label
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more