PK11URIMapping

Struct PK11URIMapping 

Source
pub struct PK11URIMapping<'a> { /* private fields */ }
Expand description

Encapsulates the result of successfully parsing a PKCS#11 URI.

Implementations§

Source§

impl<'a> PK11URIMapping<'a>

Source

pub fn token(&self) -> Option<&str>

Retrieve the value of the “token” path attribute if one was parsed.

Source

pub fn manufacturer(&self) -> Option<&str>

Retrieve the value of the “manufacturer” path attribute if one was parsed.

Source

pub fn serial(&self) -> Option<&str>

Retrieve the value of the “serial” path attribute if one was parsed.

Source

pub fn model(&self) -> Option<&str>

Retrieve the value of the “model” path attribute if one was parsed.

Source

pub fn library_manufacturer(&self) -> Option<&str>

Retrieve the value of the “library-manufacturer” path attribute if one was parsed.

Source

pub fn library_version(&self) -> Option<&str>

Retrieve the value of the “library-version” path attribute if one was parsed.

Source

pub fn library_description(&self) -> Option<&str>

Retrieve the value of the “library-description” path attribute if one was parsed.

Source

pub fn object(&self) -> Option<&str>

Retrieve the value of the “object” path attribute if one was parsed.

Source

pub fn type(&self) -> Option<&str>

Retrieve the value of the “type” path attribute if one was parsed.

Source

pub fn id(&self) -> Option<&str>

Retrieve the value of the “id” path attribute if one was parsed.

Source

pub fn slot_description(&self) -> Option<&str>

Retrieve the value of the “slot-description” path attribute if one was parsed.

Source

pub fn slot_manufacturer(&self) -> Option<&str>

Retrieve the value of the “slot-manufacturer” path attribute if one was parsed.

Source

pub fn slot_id(&self) -> Option<&str>

Retrieve the value of the “slot-id” path attribute if one was parsed.

Source

pub fn pin_source(&self) -> Option<&str>

Retrieve the value of the “pin-source” query attribute if one was parsed.

Source

pub fn pin_value(&self) -> Option<&str>

Retrieve the value of the “pin-value” query attribute if one was parsed.

Source

pub fn module_name(&self) -> Option<&str>

Retrieve the value of the “module-name” query attribute if one was parsed.

Source

pub fn module_path(&self) -> Option<&str>

Retrieve the value of the “module-path” query attribute if one was parsed.

Source

pub fn vendor(&self, vendor_attr: &str) -> Option<&Vec<&'a str>>

Retrieve the &Vec<&'a str> values for the vendor-specific vendor_attr if parsed.

§Examples
 // `v-attr` is an example "vendor-specific" attribute:
 let pk11_uri = "pkcs11:v-attr=val1?v-attr=val2&v-attr=val3";
 let mapping = pk11_uri_parser::parse(pk11_uri).expect("valid mapping");
 // Retrieve the `v-attr` values using the `vendor` method:
 let vendor_attrs = mapping.vendor("v-attr").expect("v-attr vendor-specific attribute values");
 for v_attr_val in vendor_attrs {
     println!("{v_attr_val}")
 }

prints

val1
val2
val3

Trait Implementations§

Source§

impl<'a> Clone for PK11URIMapping<'a>

Source§

fn clone(&self) -> PK11URIMapping<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for PK11URIMapping<'a>

Source§

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

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

impl<'a> Default for PK11URIMapping<'a>

Source§

fn default() -> PK11URIMapping<'a>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for PK11URIMapping<'a>

§

impl<'a> RefUnwindSafe for PK11URIMapping<'a>

§

impl<'a> Send for PK11URIMapping<'a>

§

impl<'a> Sync for PK11URIMapping<'a>

§

impl<'a> Unpin for PK11URIMapping<'a>

§

impl<'a> UnwindSafe for PK11URIMapping<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.