Struct security_framework::item::ItemAddOptions
source · pub struct ItemAddOptions {
pub value: ItemAddValue,
pub label: Option<String>,
pub location: Option<Location>,
}Expand description
Builder-pattern struct for specifying options for add_item (SecAddItem
wrapper).
When finished populating options, call to_dictionary() and pass the
resulting CFDictionary to add_item.
Fields§
§value: ItemAddValueThe value (by ref or data) of the item to add, required.
label: Option<String>Optional kSecAttrLabel attribute.
location: Option<Location>Optional keychain location.
Implementations§
source§impl ItemAddOptions
impl ItemAddOptions
sourcepub fn new(value: ItemAddValue) -> Self
pub fn new(value: ItemAddValue) -> Self
Specifies the item to add.
sourcepub fn set_label(&mut self, label: impl Into<String>) -> &mut Self
pub fn set_label(&mut self, label: impl Into<String>) -> &mut Self
Specifies the kSecAttrLabel attribute.
sourcepub fn set_location(&mut self, location: Location) -> &mut Self
pub fn set_location(&mut self, location: Location) -> &mut Self
Specifies which keychain to add the item to.
sourcepub fn to_dictionary(&self) -> CFDictionary
pub fn to_dictionary(&self) -> CFDictionary
Populates a CFDictionary to be passed to