pub struct MemoryStorage {
pub session_store: MemorySessionStore,
pub identity_store: MemoryIdentityStore,
pub pre_key_store: MemoryPreKeyStore,
pub signed_pre_key_store: MemorySignedPreKeyStore,
pub kyber_pre_key_store: MemoryKyberPreKeyStore,
}Expand description
Complete in-memory Signal Protocol storage implementation
Fields§
§session_store: MemorySessionStore§identity_store: MemoryIdentityStore§pre_key_store: MemoryPreKeyStore§signed_pre_key_store: MemorySignedPreKeyStore§kyber_pre_key_store: MemoryKyberPreKeyStoreImplementations§
Source§impl MemoryStorage
impl MemoryStorage
Source§impl MemoryStorage
impl MemoryStorage
pub async fn establish_session_from_bundle( &mut self, address: &ProtocolAddress, bundle: &PreKeyBundle, ) -> Result<(), Box<dyn Error>>
pub async fn encrypt_message( &mut self, remote_address: &ProtocolAddress, plaintext: &[u8], ) -> Result<CiphertextMessage, SignalProtocolError>
pub async fn decrypt_message( &mut self, remote_address: &ProtocolAddress, ciphertext: &CiphertextMessage, ) -> Result<Vec<u8>, SignalProtocolError>
Trait Implementations§
Source§impl Default for MemoryStorage
impl Default for MemoryStorage
Source§impl ExtendedStorageOps for MemoryStorage
impl ExtendedStorageOps for MemoryStorage
fn establish_session_from_bundle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
address: &'life1 ProtocolAddress,
bundle: &'life2 PreKeyBundle,
) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn encrypt_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
remote_address: &'life1 ProtocolAddress,
plaintext: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<CiphertextMessage, SignalProtocolError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn decrypt_message<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
remote_address: &'life1 ProtocolAddress,
ciphertext: &'life2 CiphertextMessage,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, SignalProtocolError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§impl SignalStorageContainer for MemoryStorage
impl SignalStorageContainer for MemoryStorage
type SessionStore = MemorySessionStore
type IdentityStore = MemoryIdentityStore
type PreKeyStore = MemoryPreKeyStore
type SignedPreKeyStore = MemorySignedPreKeyStore
type KyberPreKeyStore = MemoryKyberPreKeyStore
fn session_store(&mut self) -> &mut Self::SessionStore
fn identity_store(&mut self) -> &mut Self::IdentityStore
fn pre_key_store(&mut self) -> &mut Self::PreKeyStore
fn signed_pre_key_store(&mut self) -> &mut Self::SignedPreKeyStore
fn kyber_pre_key_store(&mut self) -> &mut Self::KyberPreKeyStore
fn initialize(&mut self) -> Result<(), Box<dyn Error>>
fn close(&mut self) -> Result<(), Box<dyn Error>>
fn storage_type(&self) -> &'static str
Auto Trait Implementations§
impl Freeze for MemoryStorage
impl !RefUnwindSafe for MemoryStorage
impl Send for MemoryStorage
impl Sync for MemoryStorage
impl Unpin for MemoryStorage
impl !UnwindSafe for MemoryStorage
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more