pub struct CoreCrypto { /* private fields */ }Expand description
Wrapper superstruct for both mls::session::Session and proteus::ProteusCentral
As std::ops::Deref is implemented, this struct is automatically dereferred to mls::session::Session apart from
proteus_* calls
This is cheap to clone as all internal members have Arc wrappers or are Copy.
Implementations§
Source§impl CoreCrypto
impl CoreCrypto
Sourcepub async fn history_client(history_secret: HistorySecret) -> Result<Self>
pub async fn history_client(history_secret: HistorySecret) -> Result<Self>
Instantiate a history client.
This client exposes the full interface of CoreCrypto, but it should only be used to decrypt messages.
Other use is a logic error.
Source§impl CoreCrypto
impl CoreCrypto
Sourcepub async fn proteus_session(
&self,
session_id: &str,
) -> Result<Option<Arc<RwLock<ProteusConversationSession>>>>
pub async fn proteus_session( &self, session_id: &str, ) -> Result<Option<Arc<RwLock<ProteusConversationSession>>>>
Proteus session accessor
Warning: The Proteus client MUST be initialized with crate::transaction_context::TransactionContext::proteus_init first or an error will be returned
Sourcepub async fn proteus_session_exists(&self, session_id: &str) -> Result<bool>
pub async fn proteus_session_exists(&self, session_id: &str) -> Result<bool>
Proteus session exists
Warning: The Proteus client MUST be initialized with crate::transaction_context::TransactionContext::proteus_init first or an error will be returned
Sourcepub fn proteus_last_resort_prekey_id() -> u16
pub fn proteus_last_resort_prekey_id() -> u16
Returns the proteus last resort prekey id (u16::MAX = 65535)
Sourcepub async fn proteus_fingerprint(&self) -> Result<String>
pub async fn proteus_fingerprint(&self) -> Result<String>
Returns the proteus identity’s public key fingerprint
Warning: The Proteus client MUST be initialized with crate::transaction_context::TransactionContext::proteus_init first or an error will be returned
Sourcepub async fn proteus_fingerprint_local(
&self,
session_id: &str,
) -> Result<String>
pub async fn proteus_fingerprint_local( &self, session_id: &str, ) -> Result<String>
Returns the proteus identity’s public key fingerprint
Warning: The Proteus client MUST be initialized with crate::transaction_context::TransactionContext::proteus_init first or an error will be returned
Sourcepub async fn proteus_fingerprint_remote(
&self,
session_id: &str,
) -> Result<String>
pub async fn proteus_fingerprint_remote( &self, session_id: &str, ) -> Result<String>
Returns the proteus identity’s public key fingerprint
Warning: The Proteus client MUST be initialized with crate::transaction_context::TransactionContext::proteus_init first or an error will be returned
Source§impl CoreCrypto
impl CoreCrypto
Sourcepub async fn new_transaction(&self) -> Result<TransactionContext>
pub async fn new_transaction(&self) -> Result<TransactionContext>
Creates a new transaction. All operations that persist data will be buffered in memory and when TransactionContext::finish is called, the data will be persisted in a single database transaction.
Source§impl CoreCrypto
impl CoreCrypto
Trait Implementations§
Source§impl Clone for CoreCrypto
impl Clone for CoreCrypto
Source§fn clone(&self) -> CoreCrypto
fn clone(&self) -> CoreCrypto
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CoreCrypto
impl !RefUnwindSafe for CoreCrypto
impl Send for CoreCrypto
impl Sync for CoreCrypto
impl Unpin for CoreCrypto
impl !UnwindSafe for CoreCrypto
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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