#[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_voidUser data pointer
Trait Implementations§
Source§impl Clone for signal_protocol_session_store
impl Clone for signal_protocol_session_store
Source§fn clone(&self) -> signal_protocol_session_store
fn clone(&self) -> signal_protocol_session_store
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more