pub struct KeyGrip { /* private fields */ }Expand description
KeyGrip struct manages a set of cryptographic keys Provides both thread-safe (RwLock) and non-thread-safe implementations
Implementations§
Source§impl KeyGrip
impl KeyGrip
Sourcepub fn new(keys: Vec<Vec<u8>>) -> Result<Self, Error>
pub fn new(keys: Vec<Vec<u8>>) -> Result<Self, Error>
Creates a new KeyGrip instance with non-thread-safe key storage Returns error if keys vector is empty
Sourcepub fn new_with_lock(keys: Vec<Vec<u8>>) -> Result<Self, Error>
pub fn new_with_lock(keys: Vec<Vec<u8>>) -> Result<Self, Error>
Creates a new KeyGrip instance with thread-safe key storage using RwLock
Sourcepub fn update_keys(&self, new_keys: Vec<Vec<u8>>)
pub fn update_keys(&self, new_keys: Vec<Vec<u8>>)
Updates the keys in the thread-safe storage No-op if using non-thread-safe storage
Auto Trait Implementations§
impl Freeze for KeyGrip
impl RefUnwindSafe for KeyGrip
impl Send for KeyGrip
impl Sync for KeyGrip
impl Unpin for KeyGrip
impl UnwindSafe for KeyGrip
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