[−][src]Struct der_parser::oid::Oid
Object ID (OID) representation which can be relative or non-relative. An example for an oid in string representation is "1.2.840.113549.1.1.5".
For non-relative oids restrictions apply to the first two components.
This library contains a procedural macro oid
which can be used to
create oids. For example oid!(1.2.44.233)
or oid!(rel 44.233)
for relative oids. See the module documentation for more information.
Fields
relative: bool
Implementations
impl<'a> Oid<'a>
[src]
pub const fn new(asn1: Cow<'a, [u8]>) -> Oid
[src]
Create an OID from the ASN.1 DER encoded form. See the module documentation for other ways to create oids.
pub const fn new_relative(asn1: Cow<'a, [u8]>) -> Oid
[src]
Create a relative OID from the ASN.1 DER encoded form. See the module documentation for other ways to create relative oids.
pub fn from<'b>(s: &'b [u64]) -> Result<Oid<'static>, ParseError>
[src]
Build an OID from an array of object identifier components. This method allocates memory on the heap.
pub fn from_relative<'b>(s: &'b [u64]) -> Result<Oid<'static>, ParseError>
[src]
Build a relative OID from an array of object identifier components.
pub fn to_owned(&self) -> Oid<'static>
[src]
Create a deep copy of the oid.
This method allocates data on the heap. The returned oid can be used without keeping the ASN.1 representation around.
Cloning the returned oid does again allocate data.
pub fn bytes(&self) -> &[u8]
[src]
Get the encoded oid without the header.
pub fn to_id_string(&self) -> String
[src]
Convert the OID to a string representation. The string contains the IDs separated by dots, for ex: "1.2.840.113549.1.1.5"
pub fn iter_bigint<'b>(
&'b self
) -> impl Iterator<Item = BigUint> + FusedIterator + ExactSizeIterator + 'b
[src]
&'b self
) -> impl Iterator<Item = BigUint> + FusedIterator + ExactSizeIterator + 'b
Return an iterator over the sub-identifiers (arcs).
pub fn iter<'b>(
&'b self
) -> Option<impl Iterator<Item = u64> + FusedIterator + ExactSizeIterator + 'b>
[src]
&'b self
) -> Option<impl Iterator<Item = u64> + FusedIterator + ExactSizeIterator + 'b>
Return an iterator over the sub-identifiers (arcs).
Returns None
if at least one arc does not fit into u64
.
Trait Implementations
impl<'a> Clone for Oid<'a>
[src]
impl<'a> Debug for Oid<'a>
[src]
impl<'a> Display for Oid<'a>
[src]
impl<'a> Eq for Oid<'a>
[src]
impl<'a> From<Oid<'a>> for BerObject<'a>
[src]
Build a DER object from an OID.
impl<'a> FromStr for Oid<'a>
[src]
type Err = ParseError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<'a> Hash for Oid<'a>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a> PartialEq<Oid<'a>> for Oid<'a>
[src]
impl<'a> StructuralEq for Oid<'a>
[src]
impl<'a> StructuralPartialEq for Oid<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Oid<'a>
impl<'a> Send for Oid<'a>
impl<'a> Sync for Oid<'a>
impl<'a> Unpin for Oid<'a>
impl<'a> UnwindSafe for Oid<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,