[][src]Struct yasna::models::ObjectIdentifier

pub struct ObjectIdentifier { /* fields omitted */ }

A type that represents object identifiers.

This is actually a thin wrapper of Vec<u64>.

Examples

use yasna::models::ObjectIdentifier;
let sha384WithRSAEncryption = ObjectIdentifier::from_slice(&
    [1, 2, 840, 113549, 1, 1, 12]);
println!("{}", sha384WithRSAEncryption);

Methods

impl ObjectIdentifier[src]

pub fn new(components: Vec<u64>) -> Self[src]

Constructs a new ObjectIdentifier from Vec<u64>.

Examples

use yasna::models::ObjectIdentifier;
let pkcs1 = ObjectIdentifier::new(
    [1, 2, 840, 113549, 1, 1].to_vec());
println!("{}", pkcs1);

pub fn from_slice(components: &[u64]) -> Self[src]

Constructs a new ObjectIdentifier from &[u64].

Examples

use yasna::models::ObjectIdentifier;
let pkcs1 = ObjectIdentifier::from_slice(&
    [1, 2, 840, 113549, 1, 1]);
println!("{}", pkcs1);

pub fn components(&self) -> &Vec<u64>[src]

Borrows its internal vector of components.

Examples

use yasna::models::ObjectIdentifier;
let pkcs1 = ObjectIdentifier::from_slice(&
    [1, 2, 840, 113549, 1, 1]);
let components : &Vec<u64> = pkcs1.components();

pub fn components_mut(&mut self) -> &mut Vec<u64>[src]

Mutably borrows its internal vector of components.

Examples

use yasna::models::ObjectIdentifier;
let mut pkcs1 = ObjectIdentifier::from_slice(&
    [1, 2, 840, 113549, 1, 1]);
let components : &mut Vec<u64> = pkcs1.components_mut();

pub fn into_components(self) -> Vec<u64>[src]

Extracts its internal vector of components.

Examples

use yasna::models::ObjectIdentifier;
let pkcs1 = ObjectIdentifier::from_slice(&
    [1, 2, 840, 113549, 1, 1]);
let mut components : Vec<u64> = pkcs1.into_components();

Trait Implementations

impl BERDecodable for ObjectIdentifier[src]

impl DEREncodable for ObjectIdentifier[src]

impl PartialOrd<ObjectIdentifier> for ObjectIdentifier[src]

impl AsRef<[u64]> for ObjectIdentifier[src]

impl PartialEq<ObjectIdentifier> for ObjectIdentifier[src]

impl From<Vec<u64>> for ObjectIdentifier[src]

impl Clone for ObjectIdentifier[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Ord for ObjectIdentifier[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Returns max if self is greater than max, and min if self is less than min. Otherwise this will return self. Panics if min > max. Read more

impl Eq for ObjectIdentifier[src]

impl Display for ObjectIdentifier[src]

impl Debug for ObjectIdentifier[src]

impl Hash for ObjectIdentifier[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl FromStr for ObjectIdentifier[src]

type Err = ParseOidError

The associated error which can be returned from parsing.

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]