Struct xxxdh::inmem::Storage

source ·
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,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

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>

Get an identity IdentityKeyPair.
source§

fn save_identity(&mut self, identity: &SK::PK) -> StorageResult<()>

Save a known identity.
source§

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,

source§

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<()>

Save a OnetimeKeyPair.
source§

fn forget_onetime_keypair(&mut self, key: &SK::PK) -> StorageResult<()>

Forget a OnetimeKeyPair.
source§

fn is_onetime_keys_empty(&self) -> StorageResult<bool>

Check if there are keys available.
source§

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,

source§

fn get_prekey_pair(&self) -> &KeyPair<SK>

Get a prekey PreKeyPair.
source§

fn save_prekey(&mut self, key: &SK::PK) -> StorageResult<()>

Save a known identity.
source§

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,

source§

fn new(identity_key_pair: KeyPair<SK>, prekey_pair: KeyPair<SK>) -> Self

source§

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>>

Get a signature for a key.
source§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V