libsignal-protocol 0.1.0

An idiomatic high-level interface to the libsignal-protocol-c crate.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::{raw_ptr::Raw, ContextInner};
use std::rc::Rc;

/// The internal state associated with a session.
#[derive(Debug, Clone)]
pub struct SessionState {
    pub(crate) raw: Raw<sys::session_state>,
    pub(crate) _ctx: Rc<ContextInner>,
}

impl SessionState {
    /// Get the session version.
    pub fn version(&self) -> u32 {
        unsafe { sys::session_state_get_session_version(self.raw.as_ptr()) }
    }
}