pub struct Keyring {
pub store: PathBuf,
pub primary: String,
/* private fields */
}Expand description
Gear keyring.
Fields§
§store: PathBufPath to the store.
primary: StringThe primary key.
Implementations§
Source§impl Keyring
impl Keyring
Sourcepub fn load(store: PathBuf) -> Result<Self>
pub fn load(store: PathBuf) -> Result<Self>
Loads the keyring from the store.
NOTE: For the store path, see [STORE].
Sourcepub fn set_primary(&mut self, name: String) -> Result<Keystore>
pub fn set_primary(&mut self, name: String) -> Result<Keystore>
Set the primary key.
Sourcepub fn add(
&mut self,
name: &str,
keypair: Keypair,
passphrase: Option<&str>,
) -> Result<(Keystore, Keypair)>
pub fn add( &mut self, name: &str, keypair: Keypair, passphrase: Option<&str>, ) -> Result<(Keystore, Keypair)>
Add keypair to the keyring
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Keyring
impl<'de> Deserialize<'de> for Keyring
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Keyring
impl RefUnwindSafe for Keyring
impl Send for Keyring
impl Sync for Keyring
impl Unpin for Keyring
impl UnwindSafe for Keyring
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more