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

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);

Implementations

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 AsRef<[u64]> for ObjectIdentifier[src]

impl BERDecodable for ObjectIdentifier[src]

impl Clone for ObjectIdentifier[src]

impl DEREncodable for ObjectIdentifier[src]

impl Debug for ObjectIdentifier[src]

impl Display for ObjectIdentifier[src]

impl Eq for ObjectIdentifier[src]

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

impl FromStr for ObjectIdentifier[src]

type Err = ParseOidError

The associated error which can be returned from parsing.

impl Hash for ObjectIdentifier[src]

impl Ord for ObjectIdentifier[src]

impl PartialEq<ObjectIdentifier> for ObjectIdentifier[src]

impl PartialOrd<ObjectIdentifier> for ObjectIdentifier[src]

impl StructuralEq for ObjectIdentifier[src]

impl StructuralPartialEq for ObjectIdentifier[src]

Auto Trait Implementations

impl RefUnwindSafe for ObjectIdentifier

impl Send for ObjectIdentifier

impl Sync for ObjectIdentifier

impl Unpin for ObjectIdentifier

impl UnwindSafe for ObjectIdentifier

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.