signal_protocol_session_store

Struct signal_protocol_session_store 

Source
#[repr(C)]
pub struct signal_protocol_session_store { pub load_session_func: Option<unsafe extern "C" fn(record: *mut *mut signal_buffer, user_record: *mut *mut signal_buffer, address: *const signal_protocol_address, user_data: *mut c_void) -> c_int>, pub get_sub_device_sessions_func: Option<unsafe extern "C" fn(sessions: *mut *mut signal_int_list, name: *const c_char, name_len: usize, user_data: *mut c_void) -> c_int>, pub store_session_func: Option<unsafe extern "C" fn(address: *const signal_protocol_address, record: *mut u8, record_len: usize, user_record: *mut u8, user_record_len: usize, user_data: *mut c_void) -> c_int>, pub contains_session_func: Option<unsafe extern "C" fn(address: *const signal_protocol_address, user_data: *mut c_void) -> c_int>, pub delete_session_func: Option<unsafe extern "C" fn(address: *const signal_protocol_address, user_data: *mut c_void) -> c_int>, pub delete_all_sessions_func: Option<unsafe extern "C" fn(name: *const c_char, name_len: usize, user_data: *mut c_void) -> c_int>, pub destroy_func: Option<unsafe extern "C" fn(user_data: *mut c_void)>, pub user_data: *mut c_void, }

Fields§

§load_session_func: Option<unsafe extern "C" fn(record: *mut *mut signal_buffer, user_record: *mut *mut signal_buffer, address: *const signal_protocol_address, user_data: *mut c_void) -> c_int>

Returns a copy of the serialized session record corresponding to the provided recipient ID + device ID tuple.

@param record pointer to a freshly allocated buffer containing the serialized session record. Unset if no record was found. The Signal Protocol library is responsible for freeing this buffer. @param user_record pointer to a freshly allocated buffer containing application specific data stored alongside the serialized session record. If no such data exists, then this pointer may be left unset. The Signal Protocol library is responsible for freeing this buffer. @param address the address of the remote client @return 1 if the session was loaded, 0 if the session was not found, negative on failure

§get_sub_device_sessions_func: Option<unsafe extern "C" fn(sessions: *mut *mut signal_int_list, name: *const c_char, name_len: usize, user_data: *mut c_void) -> c_int>

Returns all known devices with active sessions for a recipient

@param pointer to an array that will be allocated and populated with the result @param name the name of the remote client @param name_len the length of the name @return size of the sessions array, or negative on failure

§store_session_func: Option<unsafe extern "C" fn(address: *const signal_protocol_address, record: *mut u8, record_len: usize, user_record: *mut u8, user_record_len: usize, user_data: *mut c_void) -> c_int>

Commit to storage the session record for a given recipient ID + device ID tuple.

@param address the address of the remote client @param record pointer to a buffer containing the serialized session record for the remote client @param record_len length of the serialized session record @param user_record pointer to a buffer containing application specific data to be stored alongside the serialized session record for the remote client. If no such data exists, then this pointer will be null. @param user_record_len length of the application specific data @return 0 on success, negative on failure

§contains_session_func: Option<unsafe extern "C" fn(address: *const signal_protocol_address, user_data: *mut c_void) -> c_int>

Determine whether there is a committed session record for a recipient ID + device ID tuple.

@param address the address of the remote client @return 1 if a session record exists, 0 otherwise.

§delete_session_func: Option<unsafe extern "C" fn(address: *const signal_protocol_address, user_data: *mut c_void) -> c_int>

Remove a session record for a recipient ID + device ID tuple.

@param address the address of the remote client @return 1 if a session was deleted, 0 if a session was not deleted, negative on error

§delete_all_sessions_func: Option<unsafe extern "C" fn(name: *const c_char, name_len: usize, user_data: *mut c_void) -> c_int>

Remove the session records corresponding to all devices of a recipient ID.

@param name the name of the remote client @param name_len the length of the name @return the number of deleted sessions on success, negative on failure

§destroy_func: Option<unsafe extern "C" fn(user_data: *mut c_void)>

Function called to perform cleanup when the data store context is being destroyed.

§user_data: *mut c_void

User data pointer

Trait Implementations§

Source§

impl Clone for signal_protocol_session_store

Source§

fn clone(&self) -> signal_protocol_session_store

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for signal_protocol_session_store

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for signal_protocol_session_store

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.