pub struct Storage<SK, SIG>where
SK: SecretKey,
SIG: Signature,{ /* private fields */ }
Expand description
In-Memory key storage.
Trait Implementations§
source§impl<SK, SIG> Debug for Storage<SK, SIG>where
SK: SecretKey + Debug,
SIG: Signature + Debug,
SK::PK: Debug,
impl<SK, SIG> Debug for Storage<SK, SIG>where SK: SecretKey + Debug, SIG: Signature + Debug, SK::PK: Debug,
source§impl<SK, SIG> IdentityKeyStorage<SK> for Storage<SK, SIG>where
SK: SecretKey,
SK::PK: Eq + Hash,
SIG: Signature,
impl<SK, SIG> IdentityKeyStorage<SK> for Storage<SK, SIG>where SK: SecretKey, SK::PK: Eq + Hash, SIG: Signature,
source§fn get_identity_key_pair(&self) -> &KeyPair<SK>
fn get_identity_key_pair(&self) -> &KeyPair<SK>
Get an identity
IdentityKeyPair
.source§fn save_identity(&mut self, identity: &SK::PK) -> StorageResult<()>
fn save_identity(&mut self, identity: &SK::PK) -> StorageResult<()>
Save a known identity.
source§fn is_known_identity(&self, identity: &SK::PK) -> StorageResult<bool>
fn is_known_identity(&self, identity: &SK::PK) -> StorageResult<bool>
Check if an identity is known.
source§impl<SK, SIG> OnetimeKeyStorage<SK> for Storage<SK, SIG>where
SK: SecretKey,
SK::PK: Eq + Hash,
SIG: Signature,
impl<SK, SIG> OnetimeKeyStorage<SK> for Storage<SK, SIG>where SK: SecretKey, SK::PK: Eq + Hash, SIG: Signature,
source§fn get_onetime_keypair(
&self,
key: &SK::PK
) -> StorageResult<Option<&KeyPair<SK>>>
fn get_onetime_keypair( &self, key: &SK::PK ) -> StorageResult<Option<&KeyPair<SK>>>
Get a
OnetimeKeyPair
.source§fn save_onetime_keypair(&mut self, keypair: KeyPair<SK>) -> StorageResult<()>
fn save_onetime_keypair(&mut self, keypair: KeyPair<SK>) -> StorageResult<()>
Save a
OnetimeKeyPair
.source§fn forget_onetime_keypair(&mut self, key: &SK::PK) -> StorageResult<()>
fn forget_onetime_keypair(&mut self, key: &SK::PK) -> StorageResult<()>
Forget a
OnetimeKeyPair
.source§fn is_onetime_keys_empty(&self) -> StorageResult<bool>
fn is_onetime_keys_empty(&self) -> StorageResult<bool>
Check if there are keys available.
source§fn provide_ontime_key(&self) -> StorageResult<Option<&SK::PK>>
fn provide_ontime_key(&self) -> StorageResult<Option<&SK::PK>>
Provide a single onetime key. Returns
None
if storage is empty.source§impl<SK, SIG> PreKeyStorage<SK> for Storage<SK, SIG>where
SK: SecretKey,
SK::PK: Eq + Hash,
SIG: Signature,
impl<SK, SIG> PreKeyStorage<SK> for Storage<SK, SIG>where SK: SecretKey, SK::PK: Eq + Hash, SIG: Signature,
source§fn get_prekey_pair(&self) -> &KeyPair<SK>
fn get_prekey_pair(&self) -> &KeyPair<SK>
Get a prekey
PreKeyPair
.source§fn save_prekey(&mut self, key: &SK::PK) -> StorageResult<()>
fn save_prekey(&mut self, key: &SK::PK) -> StorageResult<()>
Save a known identity.
source§fn is_known_prekey(&self, key: &SK::PK) -> StorageResult<bool>
fn is_known_prekey(&self, key: &SK::PK) -> StorageResult<bool>
Check if a prekey is known.
source§impl<SK, SIG> ProtocolStorage<SK, <SK as SecretKey>::PK, SIG> for Storage<SK, SIG>where
SK: SecretKey,
SK::PK: Eq + Hash,
SIG: Signature,
impl<SK, SIG> ProtocolStorage<SK, <SK as SecretKey>::PK, SIG> for Storage<SK, SIG>where SK: SecretKey, SK::PK: Eq + Hash, SIG: Signature,
source§impl<SK, SIG> SignatureStorage<<SK as SecretKey>::PK, SIG> for Storage<SK, SIG>where
SK: SecretKey,
SK::PK: Eq + Hash,
SIG: Signature,
impl<SK, SIG> SignatureStorage<<SK as SecretKey>::PK, SIG> for Storage<SK, SIG>where SK: SecretKey, SK::PK: Eq + Hash, SIG: Signature,
source§fn get_signature(&self, key: &SK::PK) -> StorageResult<Option<&SIG>>
fn get_signature(&self, key: &SK::PK) -> StorageResult<Option<&SIG>>
Get a signature for a key.
source§fn save_signature(&mut self, key: SK::PK, signature: SIG) -> StorageResult<()>
fn save_signature(&mut self, key: SK::PK, signature: SIG) -> StorageResult<()>
Save a signature.
Auto Trait Implementations§
impl<SK, SIG> RefUnwindSafe for Storage<SK, SIG>where SIG: RefUnwindSafe, SK: RefUnwindSafe, <SK as SecretKey>::PK: RefUnwindSafe,
impl<SK, SIG> Send for Storage<SK, SIG>where SIG: Send, SK: Send, <SK as SecretKey>::PK: Send,
impl<SK, SIG> Sync for Storage<SK, SIG>where SIG: Sync, SK: Sync, <SK as SecretKey>::PK: Sync,
impl<SK, SIG> Unpin for Storage<SK, SIG>where SIG: Unpin, SK: Unpin, <SK as SecretKey>::PK: Unpin,
impl<SK, SIG> UnwindSafe for Storage<SK, SIG>where SIG: UnwindSafe, SK: UnwindSafe, <SK as SecretKey>::PK: UnwindSafe,
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