Struct libsignal_service::cipher::ServiceCipher
source · pub struct ServiceCipher<S, R> { /* private fields */ }
Expand description
Decrypts incoming messages and encrypts outgoing messages.
Equivalent of SignalServiceCipher in Java.
Implementations§
source§impl<S, R> ServiceCipher<S, R>
impl<S, R> ServiceCipher<S, R>
pub fn new( protocol_store: S, csprng: R, trust_root: PublicKey, local_uuid: Uuid, local_device_id: u32, ) -> Self
sourcepub async fn open_envelope(
&mut self,
envelope: Envelope,
) -> Result<Option<Content>, ServiceError>
pub async fn open_envelope( &mut self, envelope: Envelope, ) -> Result<Option<Content>, ServiceError>
Opens (“decrypts”) an envelope.
Envelopes may be empty, in which case this method returns Ok(None)
Trait Implementations§
Auto Trait Implementations§
impl<S, R> Freeze for ServiceCipher<S, R>
impl<S, R> RefUnwindSafe for ServiceCipher<S, R>where
S: RefUnwindSafe,
R: RefUnwindSafe,
impl<S, R> Send for ServiceCipher<S, R>
impl<S, R> Sync for ServiceCipher<S, R>
impl<S, R> Unpin for ServiceCipher<S, R>
impl<S, R> UnwindSafe for ServiceCipher<S, R>where
S: UnwindSafe,
R: 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§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