pub struct SocketControl { /* private fields */ }Expand description
State publisher and reconnect registration for one logical socket endpoint.
A clone starts without ownership of the source control’s active transport generation.
Implementations§
Source§impl SocketControl
impl SocketControl
Sourcepub fn new(
client_id: ClientId,
venue: Option<Venue>,
endpoint: impl AsRef<str>,
) -> Self
pub fn new( client_id: ClientId, venue: Option<Venue>, endpoint: impl AsRef<str>, ) -> Self
Creates a new SocketControl instance.
Sourcepub fn with_registry(
client_id: ClientId,
venue: Option<Venue>,
endpoint: impl AsRef<str>,
registry: &SocketReconnectRegistry,
) -> Self
pub fn with_registry( client_id: ClientId, venue: Option<Venue>, endpoint: impl AsRef<str>, registry: &SocketReconnectRegistry, ) -> Self
Creates a control which registers with an explicit live socket registry.
Sourcepub fn sink(&self) -> SocketStateSink
pub fn sink(&self) -> SocketStateSink
Returns a sink which publishes transport state changes as system events.
Sourcepub fn sink_with<F>(&self, on_state: F) -> SocketStateSink
pub fn sink_with<F>(&self, on_state: F) -> SocketStateSink
Returns a state sink which calls on_state before publishing each change.
on_state must not synchronously trigger another state change for the same endpoint.
Sourcepub fn register<F>(&self, request: F)
pub fn register<F>(&self, request: F)
Registers a reconnect request function for this endpoint’s active generation.
Sourcepub fn deregister(&self)
pub fn deregister(&self)
Removes the reconnect handle owned by this control generation.
Trait Implementations§
Source§impl Clone for SocketControl
impl Clone for SocketControl
Source§impl Debug for SocketControl
impl Debug for SocketControl
Source§impl Drop for SocketControl
impl Drop for SocketControl
Auto Trait Implementations§
impl !Freeze for SocketControl
impl !RefUnwindSafe for SocketControl
impl !UnwindSafe for SocketControl
impl Send for SocketControl
impl Sync for SocketControl
impl Unpin for SocketControl
impl UnsafeUnpin for SocketControl
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more