pub struct ObjectIdentifierRef { /* private fields */ }
Expand description

OID reference type: wrapper for the BER serialization.

Implementations§

source§

impl ObjectIdentifierRef

source

pub fn from_bytes(ber: &[u8]) -> Result<&Self>

Create an ObjectIdentifierRef, validating that the provided byte slice contains a valid BER/DER encoding.

source

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.

source

pub fn arc(&self, index: usize) -> Option<Arc>

Return the arc with the given index, if it exists.

source

pub fn arcs(&self) -> Arcs<'_>

Iterate over the arcs (a.k.a. nodes) of an ObjectIdentifier.

Returns Arcs, an iterator over Arc values.

source

pub fn len(&self) -> usize

Get the length of this ObjectIdentifier in arcs.

Trait Implementations§

source§

impl AsRef<[u8]> for ObjectIdentifierRef

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<const MAX_SIZE: usize> AsRef<ObjectIdentifierRef> for ObjectIdentifier<MAX_SIZE>

source§

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>

source§

fn borrow(&self) -> &ObjectIdentifierRef

Immutably borrows from an owned value. Read more
source§

impl Debug for ObjectIdentifierRef

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ObjectIdentifierRef

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, const MAX_SIZE: usize> From<&'a ObjectIdentifier<MAX_SIZE>> for &'a ObjectIdentifierRef

source§

fn from(oid: &'a ObjectIdentifier<MAX_SIZE>) -> &'a ObjectIdentifierRef

Converts to this type from the input type.
source§

impl Hash for ObjectIdentifierRef

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
source§

impl Ord for ObjectIdentifierRef

source§

fn cmp(&self, other: &ObjectIdentifierRef) -> Ordering

This method returns an Ordering between self and other. Read more
source§

impl<const MAX_SIZE: usize> PartialEq<ObjectIdentifier<MAX_SIZE>> for ObjectIdentifierRef

source§

fn eq(&self, other: &ObjectIdentifier<MAX_SIZE>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq for ObjectIdentifierRef

source§

fn eq(&self, other: &ObjectIdentifierRef) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for ObjectIdentifierRef

source§

fn partial_cmp(&self, other: &ObjectIdentifierRef) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<'a> TryFrom<&'a [u8]> for &'a ObjectIdentifierRef

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(ber_bytes: &'a [u8]) -> Result<Self>

Performs the conversion.
source§

impl<const MAX_SIZE: usize> TryFrom<&ObjectIdentifierRef> for ObjectIdentifier<MAX_SIZE>

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(oid_ref: &ObjectIdentifierRef) -> Result<Self>

Performs the conversion.
source§

impl Eq for ObjectIdentifierRef

source§

impl StructuralEq for ObjectIdentifierRef

source§

impl StructuralPartialEq for ObjectIdentifierRef

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more