pub struct SqliteStorage { /* private fields */ }Expand description
SQLite-backed Signal Protocol storage with data persistence
Implementations§
Source§impl SqliteStorage
impl SqliteStorage
pub async fn new(db_path: &str) -> Result<Self, Box<dyn Error>>
pub fn is_closed(&self) -> bool
pub fn initialize_schema(&mut self) -> Result<(), Box<dyn Error>>
pub fn get_schema_version(&self) -> Result<i32, Box<dyn Error>>
pub fn connection(&self) -> Arc<Mutex<Connection>>
pub fn message_history(&self) -> &MessageHistory
pub fn get_last_message_timestamp(&self) -> Result<u64, Box<dyn Error>>
pub fn set_last_message_timestamp( &mut self, timestamp: u64, ) -> Result<(), Box<dyn Error>>
pub fn record_published_bundle( &mut self, pre_key_id: u32, signed_pre_key_id: u32, kyber_pre_key_id: u32, ) -> Result<(), Box<dyn Error>>
pub fn get_last_published_bundle_metadata( &self, ) -> Result<Option<(u32, u32, u32)>, Box<dyn Error>>
Trait Implementations§
Source§impl ExtendedStorageOps for SqliteStorage
impl ExtendedStorageOps for SqliteStorage
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 SqliteStorage
impl SignalStorageContainer for SqliteStorage
type SessionStore = SqliteSessionStore
type IdentityStore = SqliteIdentityStore
type PreKeyStore = SqlitePreKeyStore
type SignedPreKeyStore = SqliteSignedPreKeyStore
type KyberPreKeyStore = SqliteKyberPreKeyStore
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 SqliteStorage
impl RefUnwindSafe for SqliteStorage
impl Send for SqliteStorage
impl Sync for SqliteStorage
impl Unpin for SqliteStorage
impl UnwindSafe for SqliteStorage
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