pub struct ProtocolSessionState<T>(/* private fields */);Expand description
This facility helps user capture and maintain protocol state across a single connection. Unlike ProtocolConnectionState this facility designed to works across a session which spans across multiple connected/disconnected connections
§Use cases
- Use this to maintain a log of messages sent and received
- Use this to recover crate::prelude::Clt state after reconnect to crate::prelude::Svc since crate::prelude::Svc will have access to all of the activity across all connections.
§Key features
- Each new connection to crate::prelude::Svc will have access to any state captured by prior or still active connections
on the same crate::prelude::Svc port. This is achieved by using Clone implementation of Arc’s container for
T.
Implementations§
Source§impl<T> ProtocolSessionState<T>
impl<T> ProtocolSessionState<T>
Trait Implementations§
Source§impl<T> Clone for ProtocolSessionState<T>
impl<T> Clone for ProtocolSessionState<T>
Source§impl<T: Debug> Debug for ProtocolSessionState<T>
impl<T: Debug> Debug for ProtocolSessionState<T>
Source§impl<T: Default> Default for ProtocolSessionState<T>
impl<T: Default> Default for ProtocolSessionState<T>
Source§impl<T: Debug> From<InMemoryMessageLog<T>> for ProtocolSessionState<InMemoryMessageLog<T>>
impl<T: Debug> From<InMemoryMessageLog<T>> for ProtocolSessionState<InMemoryMessageLog<T>>
Source§fn from(value: InMemoryMessageLog<T>) -> Self
fn from(value: InMemoryMessageLog<T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<T> Freeze for ProtocolSessionState<T>
impl<T> !RefUnwindSafe for ProtocolSessionState<T>
impl<T> Send for ProtocolSessionState<T>where
T: Send,
impl<T> Sync for ProtocolSessionState<T>where
T: Send,
impl<T> Unpin for ProtocolSessionState<T>
impl<T> !UnwindSafe for ProtocolSessionState<T>
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