pub struct SessionHandle { /* private fields */ }Expand description
FFI wrapper for Session.
Implementations§
Source§impl SessionHandle
impl SessionHandle
Sourcepub fn init(
their_ephemeral_pubkey_hex: String,
our_ephemeral_privkey_hex: String,
is_initiator: bool,
shared_secret_hex: String,
name: Option<String>,
) -> Result<Arc<Self>, NdrError>
pub fn init( their_ephemeral_pubkey_hex: String, our_ephemeral_privkey_hex: String, is_initiator: bool, shared_secret_hex: String, name: Option<String>, ) -> Result<Arc<Self>, NdrError>
Initialize a new session.
Sourcepub fn from_state_json(state_json: String) -> Result<Arc<Self>, NdrError>
pub fn from_state_json(state_json: String) -> Result<Arc<Self>, NdrError>
Restore a session from serialized state JSON.
Sourcepub fn state_json(&self) -> Result<String, NdrError>
pub fn state_json(&self) -> Result<String, NdrError>
Serialize the session state to JSON.
Sourcepub fn decrypt_event(
&self,
outer_event_json: String,
) -> Result<DecryptResult, NdrError>
pub fn decrypt_event( &self, outer_event_json: String, ) -> Result<DecryptResult, NdrError>
Decrypt a received event.
Sourcepub fn is_dr_message(&self, event_json: String) -> bool
pub fn is_dr_message(&self, event_json: String) -> bool
Check if an event is a double-ratchet message.
Trait Implementations§
Source§impl<UT> LiftRef<UT> for SessionHandle
impl<UT> LiftRef<UT> for SessionHandle
type LiftType = Arc<SessionHandle>
Source§impl<UT> LowerError<UT> for SessionHandle
impl<UT> LowerError<UT> for SessionHandle
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Lower this value for scaffolding function return Read more
Source§impl<UT> LowerReturn<UT> for SessionHandle
impl<UT> LowerReturn<UT> for SessionHandle
Source§type ReturnType = <Arc<SessionHandle> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<SessionHandle> as LowerReturn<UniFfiTag>>::ReturnType
The type that should be returned by scaffolding functions for this type. Read more
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
Lower the return value from an scaffolding call Read more
Source§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Lower the return value for failed argument lifts Read more
Source§impl<UT> TypeId<UT> for SessionHandle
impl<UT> TypeId<UT> for SessionHandle
Auto Trait Implementations§
impl !Freeze for SessionHandle
impl RefUnwindSafe for SessionHandle
impl Send for SessionHandle
impl Sync for SessionHandle
impl Unpin for SessionHandle
impl UnsafeUnpin for SessionHandle
impl UnwindSafe for SessionHandle
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