pub struct Keyring { /* private fields */ }Expand description
In-memory collection of unlocked keys.
Implementations§
Source§impl Keyring
impl Keyring
Sourcepub fn load_key(
&mut self,
pubkey: [u8; 32],
secret: [u8; 32],
key_type: KeyType,
name: String,
) -> Result<()>
pub fn load_key( &mut self, pubkey: [u8; 32], secret: [u8; 32], key_type: KeyType, name: String, ) -> Result<()>
Load a key into the keyring.
Sourcepub fn get(&self, pubkey: &[u8; 32]) -> Option<&KeySlot>
pub fn get(&self, pubkey: &[u8; 32]) -> Option<&KeySlot>
Get a key slot by public key, if present.
Sourcepub fn get_mut(&mut self, pubkey: &[u8; 32]) -> Option<&mut KeySlot>
pub fn get_mut(&mut self, pubkey: &[u8; 32]) -> Option<&mut KeySlot>
Get a mutable key slot by public key, if present.
Sourcepub fn get_by_name(&self, name: &str) -> Option<&KeySlot>
pub fn get_by_name(&self, name: &str) -> Option<&KeySlot>
Get a key slot by name, if present.
Sourcepub fn get_primary(&self) -> Option<&KeySlot>
pub fn get_primary(&self) -> Option<&KeySlot>
Get the primary key slot, if set.
Sourcepub fn get_primary_mut(&mut self) -> Option<&mut KeySlot>
pub fn get_primary_mut(&mut self) -> Option<&mut KeySlot>
Get a mutable reference to the primary key slot, if set.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Keyring
impl Freeze for Keyring
impl Move for Keyring
impl RefUnwindSafe for Keyring
impl Send for Keyring
impl Sync for Keyring
impl Unpin for Keyring
impl UnsafeUnpin 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