pub enum Label {
Int(i64),
Text(String),
}Expand description
A COSE label may be either a signed integer value or a string.
Variants§
Implementations§
Source§impl Label
impl Label
Sourcepub fn cmp_canonical(&self, other: &Label) -> Ordering
pub fn cmp_canonical(&self, other: &Label) -> Ordering
Alternative ordering for Label, using the canonical ordering criteria from RFC 7049
section 3.9 (where the primary sorting criterion is the length of the encoded form), rather
than the ordering given by RFC 8949 section 4.2.1 (lexicographic ordering of encoded form).
§Panics
Panics if either Label fails to serialize.
Trait Implementations§
Source§impl AsCborValue for Label
impl AsCborValue for Label
Source§impl CborSerializable for Label
impl CborSerializable for Label
Source§impl Ord for Label
Manual implementation of Ord to ensure that CBOR canonical ordering is respected.
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 PartialOrd for Label
impl PartialOrd for Label
impl Eq for Label
impl StructuralPartialEq for Label
Auto Trait Implementations§
impl Freeze for Label
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
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
fn equivalent(&self, key: &K) -> bool
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
Source§impl<T> ResourceProvider<()> for T
impl<T> ResourceProvider<()> for T
Source§fn get_resource(&self) -> &()
fn get_resource(&self) -> &()
Returns a reference to the resource of type
T.