pub struct ObjectIdentifierRef { /* private fields */ }
Expand description
OID reference type: wrapper for the BER serialization.
Implementations§
Source§impl ObjectIdentifierRef
impl ObjectIdentifierRef
Sourcepub fn from_bytes(ber: &[u8]) -> Result<&Self>
pub fn from_bytes(ber: &[u8]) -> Result<&Self>
Create an ObjectIdentifierRef
, validating that the provided byte slice contains a valid
BER/DER encoding.
Sourcepub const fn as_bytes(&self) -> &[u8] ⓘ
pub const fn as_bytes(&self) -> &[u8] ⓘ
Get the BER/DER serialization of this OID as bytes.
Note that this encoding omits the ASN.1 tag/length, and only contains the value portion of the encoded OID.
Sourcepub fn arc(&self, index: usize) -> Option<Arc>
pub fn arc(&self, index: usize) -> Option<Arc>
Return the arc with the given index, if it exists.
Sourcepub fn arcs(&self) -> Arcs<'_> ⓘ
pub fn arcs(&self) -> Arcs<'_> ⓘ
Iterate over the arcs (a.k.a. nodes) of an ObjectIdentifier
.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Get the length of this ObjectIdentifier
in arcs.
Trait Implementations§
Source§impl AsRef<[u8]> for ObjectIdentifierRef
impl AsRef<[u8]> for ObjectIdentifierRef
Source§impl<const MAX_SIZE: usize> AsRef<ObjectIdentifierRef> for ObjectIdentifier<MAX_SIZE>
impl<const MAX_SIZE: usize> AsRef<ObjectIdentifierRef> for ObjectIdentifier<MAX_SIZE>
Source§fn as_ref(&self) -> &ObjectIdentifierRef
fn as_ref(&self) -> &ObjectIdentifierRef
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<const MAX_SIZE: usize> Borrow<ObjectIdentifierRef> for ObjectIdentifier<MAX_SIZE>
impl<const MAX_SIZE: usize> Borrow<ObjectIdentifierRef> for ObjectIdentifier<MAX_SIZE>
Source§fn borrow(&self) -> &ObjectIdentifierRef
fn borrow(&self) -> &ObjectIdentifierRef
Immutably borrows from an owned value. Read more
Source§impl Debug for ObjectIdentifierRef
impl Debug for ObjectIdentifierRef
Source§impl Display for ObjectIdentifierRef
impl Display for ObjectIdentifierRef
Source§impl<'a, const MAX_SIZE: usize> From<&'a ObjectIdentifier<MAX_SIZE>> for &'a ObjectIdentifierRef
impl<'a, const MAX_SIZE: usize> From<&'a ObjectIdentifier<MAX_SIZE>> for &'a ObjectIdentifierRef
Source§fn from(oid: &'a ObjectIdentifier<MAX_SIZE>) -> &'a ObjectIdentifierRef
fn from(oid: &'a ObjectIdentifier<MAX_SIZE>) -> &'a ObjectIdentifierRef
Converts to this type from the input type.