security_framework::authorization

Struct AuthorizationItemSetBuilder

Source
pub struct AuthorizationItemSetBuilder { /* private fields */ }
Expand description

A convenience AuthorizationItemSetBuilder builder which enabled you to use rust types. All names and values passed in will be copied.

Implementations§

Source§

impl AuthorizationItemSetBuilder

Source

pub fn new() -> AuthorizationItemSetBuilder

Creates a new AuthorizationItemSetStore, which simplifies creating owned vectors of AuthorizationItems.

Source

pub fn add_right<N: Into<Vec<u8>>>(self, name: N) -> Result<Self>

Adds an AuthorizationItem with the name set to a right and an empty value.

If name isn’t convertable to a CString it will return Err(errSecConversionError).

Source

pub fn add_data<N, V>(self, name: N, value: V) -> Result<Self>
where N: Into<Vec<u8>>, V: Into<Vec<u8>>,

Adds an AuthorizationItem with arbitrary data.

If name isn’t convertable to a CString it will return Err(errSecConversionError).

Source

pub fn add_string<N, V>(self, name: N, value: V) -> Result<Self>
where N: Into<Vec<u8>>, V: Into<Vec<u8>>,

Adds an AuthorizationItem with NULL terminated string data.

If name or value isn’t convertable to a CString it will return Err(errSecConversionError).

Source

pub fn build(self) -> AuthorizationItemSetStorage

Creates the sys::AuthorizationItemSet, and gives you ownership of the data it points to.

Trait Implementations§

Source§

impl Debug for AuthorizationItemSetBuilder

Source§

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

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

impl Default for AuthorizationItemSetBuilder

Source§

fn default() -> AuthorizationItemSetBuilder

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

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> 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, 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.