pub struct SocketStateSink { /* private fields */ }Expand description
Receives ordered semantic state changes from a single socket client.
Clients must route every transition into or out of ConnectionMode::Active through the
sink-backed transition methods so each edge is reported once.
Implementations§
Source§impl SocketStateSink
impl SocketStateSink
Sourcepub fn new<F>(callback: F) -> Self
pub fn new<F>(callback: F) -> Self
Creates a new SocketStateSink instance.
The callback runs synchronously with each successful state transition and should return promptly. It must not initiate another transition using the same sink because callbacks are serialized under a non-reentrant lock.
Sourcepub fn with_callback<F>(self, callback: F) -> Self
pub fn with_callback<F>(self, callback: F) -> Self
Returns a sink that invokes callback before forwarding each state to this sink.
Trait Implementations§
Source§impl Clone for SocketStateSink
impl Clone for SocketStateSink
Source§fn clone(&self) -> SocketStateSink
fn clone(&self) -> SocketStateSink
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for SocketStateSink
impl !UnwindSafe for SocketStateSink
impl Freeze for SocketStateSink
impl Send for SocketStateSink
impl Sync for SocketStateSink
impl Unpin for SocketStateSink
impl UnsafeUnpin for SocketStateSink
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