Struct bc_components::ARID
source · pub struct ARID(/* private fields */);Expand description
An “Apparently Random Identifier” (ARID)
As defined in BCR-2022-002.
Implementations§
source§impl ARID
impl ARID
pub const ARID_SIZE: usize = 32usize
sourcepub fn from_data_ref<T>(data: &T) -> Option<Self>where
T: AsRef<[u8]>,
pub fn from_data_ref<T>(data: &T) -> Option<Self>where T: AsRef<[u8]>,
Create a new ARID from a reference to an array of bytes.
sourcepub fn from_hex<T>(hex: T) -> Selfwhere
T: AsRef<str>,
pub fn from_hex<T>(hex: T) -> Selfwhere T: AsRef<str>,
Create a new ARID from the given hexadecimal string.
Panics
Panics if the string is not exactly 64 hexadecimal digits.
sourcepub fn short_description(&self) -> String
pub fn short_description(&self) -> String
The first four bytes of the ARID as a hexadecimal string.
Trait Implementations§
source§impl CBORDecodable for ARID
impl CBORDecodable for ARID
source§impl CBOREncodable for ARID
impl CBOREncodable for ARID
source§impl CBORTagged for ARID
impl CBORTagged for ARID
source§impl CBORTaggedDecodable for ARID
impl CBORTaggedDecodable for ARID
source§fn from_untagged_cbor(untagged_cbor: &CBOR) -> Result<Self, Error>
fn from_untagged_cbor(untagged_cbor: &CBOR) -> Result<Self, Error>
Creates an instance of this type by decoding it from untagged CBOR.
source§fn from_tagged_cbor(cbor: &CBOR) -> Result<Self, Error>where
Self: Sized,
fn from_tagged_cbor(cbor: &CBOR) -> Result<Self, Error>where Self: Sized,
Creates an instance of this type by decoding it from tagged CBOR.
source§impl CBORTaggedEncodable for ARID
impl CBORTaggedEncodable for ARID
source§fn untagged_cbor(&self) -> CBOR
fn untagged_cbor(&self) -> CBOR
Returns the untagged CBOR encoding of this instance.
source§fn tagged_cbor(&self) -> CBOR
fn tagged_cbor(&self) -> CBOR
Returns the tagged CBOR encoding of this instance.
source§impl PartialEq<ARID> for ARID
impl PartialEq<ARID> for ARID
source§impl PartialOrd<ARID> for ARID
impl PartialOrd<ARID> for ARID
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 ARID
impl StructuralEq for ARID
impl StructuralPartialEq for ARID
Auto Trait Implementations§
impl RefUnwindSafe for ARID
impl Send for ARID
impl Sync for ARID
impl Unpin for ARID
impl UnwindSafe for ARID
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