signal_protocol_pre_key_store

Struct signal_protocol_pre_key_store 

Source
#[repr(C)]
pub struct signal_protocol_pre_key_store { pub load_pre_key: Option<unsafe extern "C" fn(record: *mut *mut signal_buffer, pre_key_id: u32, user_data: *mut c_void) -> c_int>, pub store_pre_key: Option<unsafe extern "C" fn(pre_key_id: u32, record: *mut u8, record_len: usize, user_data: *mut c_void) -> c_int>, pub contains_pre_key: Option<unsafe extern "C" fn(pre_key_id: u32, user_data: *mut c_void) -> c_int>, pub remove_pre_key: Option<unsafe extern "C" fn(pre_key_id: u32, 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_pre_key: Option<unsafe extern "C" fn(record: *mut *mut signal_buffer, pre_key_id: u32, user_data: *mut c_void) -> c_int>

Load a local serialized PreKey record.

@param record pointer to a newly allocated buffer containing the record, if found. Unset if no record was found. The Signal Protocol library is responsible for freeing this buffer. @param pre_key_id the ID of the local serialized PreKey record @retval SG_SUCCESS if the key was found @retval SG_ERR_INVALID_KEY_ID if the key could not be found

§store_pre_key: Option<unsafe extern "C" fn(pre_key_id: u32, record: *mut u8, record_len: usize, user_data: *mut c_void) -> c_int>

Store a local serialized PreKey record.

@param pre_key_id the ID of the PreKey record to store. @param record pointer to a buffer containing the serialized record @param record_len length of the serialized record @return 0 on success, negative on failure

§contains_pre_key: Option<unsafe extern "C" fn(pre_key_id: u32, user_data: *mut c_void) -> c_int>

Determine whether there is a committed PreKey record matching the provided ID.

@param pre_key_id A PreKey record ID. @return 1 if the store has a record for the PreKey ID, 0 otherwise

§remove_pre_key: Option<unsafe extern "C" fn(pre_key_id: u32, user_data: *mut c_void) -> c_int>

Delete a PreKey record from local storage.

@param pre_key_id The ID of the PreKey record to remove. @return 0 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_pre_key_store

Source§

fn clone(&self) -> signal_protocol_pre_key_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_pre_key_store

Source§

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

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

impl Copy for signal_protocol_pre_key_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.