Struct mpc_protocol::SessionManager
source · pub struct SessionManager { /* private fields */ }
Expand description
Manages a collection of sessions.
Implementations§
source§impl SessionManager
impl SessionManager
sourcepub fn new_session(
&mut self,
owner_key: Vec<u8>,
participant_keys: Vec<Vec<u8>>
) -> SessionId
pub fn new_session( &mut self, owner_key: Vec<u8>, participant_keys: Vec<Vec<u8>> ) -> SessionId
Create a new session.
sourcepub fn get_session(&self, id: &SessionId) -> Option<&Session>
pub fn get_session(&self, id: &SessionId) -> Option<&Session>
Get a session.
sourcepub fn get_session_mut(&mut self, id: &SessionId) -> Option<&mut Session>
pub fn get_session_mut(&mut self, id: &SessionId) -> Option<&mut Session>
Get a mutable session.
sourcepub fn remove_session(&mut self, id: &SessionId) -> Option<Session>
pub fn remove_session(&mut self, id: &SessionId) -> Option<Session>
Remove a session.
sourcepub fn touch_session(&mut self, id: &SessionId) -> Option<&Session>
pub fn touch_session(&mut self, id: &SessionId) -> Option<&Session>
Retrieve and update the last access time for a session.
sourcepub fn expired_keys(&self, timeout: u64) -> Vec<SessionId>
pub fn expired_keys(&self, timeout: u64) -> Vec<SessionId>
Get the keys of sessions that have expired.
Trait Implementations§
source§impl Default for SessionManager
impl Default for SessionManager
source§fn default() -> SessionManager
fn default() -> SessionManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for SessionManager
impl Send for SessionManager
impl Sync for SessionManager
impl Unpin for SessionManager
impl UnwindSafe for SessionManager
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