pub enum SocketUpdate<Sink, T> {
Connected(Sink),
Reconnecting,
Item(T),
}Expand description
Socket lifecycle events wrapping stream items.
Variants§
Connected(Sink)
Socket connected, providing the sink for sending data.
Reconnecting
Socket disconnected, reconnection in progress.
Item(T)
Data item received from the socket.
Implementations§
Source§impl<Sink, T> SocketUpdate<Sink, T>
impl<Sink, T> SocketUpdate<Sink, T>
Sourcepub fn map<F, O>(self, op: F) -> SocketUpdate<Sink, O>where
F: FnOnce(T) -> O,
pub fn map<F, O>(self, op: F) -> SocketUpdate<Sink, O>where
F: FnOnce(T) -> O,
Maps the item using the provided function.
Source§impl<Sink, T, E> SocketUpdate<Sink, Result<T, E>>
impl<Sink, T, E> SocketUpdate<Sink, Result<T, E>>
Sourcepub fn map_ok<F, O>(self, op: F) -> SocketUpdate<Sink, Result<O, E>>where
F: FnOnce(T) -> O,
pub fn map_ok<F, O>(self, op: F) -> SocketUpdate<Sink, Result<O, E>>where
F: FnOnce(T) -> O,
Maps the Ok value of a Result item.
Sourcepub fn map_err<F, O>(self, op: F) -> SocketUpdate<Sink, Result<T, O>>where
F: FnOnce(E) -> O,
pub fn map_err<F, O>(self, op: F) -> SocketUpdate<Sink, Result<T, O>>where
F: FnOnce(E) -> O,
Maps the Err value of a Result item.
Trait Implementations§
Source§impl<Sink: Clone, T: Clone> Clone for SocketUpdate<Sink, T>
impl<Sink: Clone, T: Clone> Clone for SocketUpdate<Sink, T>
Source§fn clone(&self) -> SocketUpdate<Sink, T>
fn clone(&self) -> SocketUpdate<Sink, T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de, Sink, T> Deserialize<'de> for SocketUpdate<Sink, T>where
Sink: Deserialize<'de>,
T: Deserialize<'de>,
impl<'de, Sink, T> Deserialize<'de> for SocketUpdate<Sink, T>where
Sink: Deserialize<'de>,
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<Sink, T> From<T> for SocketUpdate<Sink, T>
impl<Sink, T> From<T> for SocketUpdate<Sink, T>
Source§impl<Sink: Ord, T: Ord> Ord for SocketUpdate<Sink, T>
impl<Sink: Ord, T: Ord> Ord for SocketUpdate<Sink, T>
Source§fn cmp(&self, other: &SocketUpdate<Sink, T>) -> Ordering
fn cmp(&self, other: &SocketUpdate<Sink, T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<Sink: PartialOrd, T: PartialOrd> PartialOrd for SocketUpdate<Sink, T>
impl<Sink: PartialOrd, T: PartialOrd> PartialOrd for SocketUpdate<Sink, T>
Source§impl<Sink, T> Serialize for SocketUpdate<Sink, T>
impl<Sink, T> Serialize for SocketUpdate<Sink, T>
impl<Sink: Copy, T: Copy> Copy for SocketUpdate<Sink, T>
impl<Sink: Eq, T: Eq> Eq for SocketUpdate<Sink, T>
impl<Sink, T> StructuralPartialEq for SocketUpdate<Sink, T>
Auto Trait Implementations§
impl<Sink, T> Freeze for SocketUpdate<Sink, T>
impl<Sink, T> RefUnwindSafe for SocketUpdate<Sink, T>where
Sink: RefUnwindSafe,
T: RefUnwindSafe,
impl<Sink, T> Send for SocketUpdate<Sink, T>
impl<Sink, T> Sync for SocketUpdate<Sink, T>
impl<Sink, T> Unpin for SocketUpdate<Sink, T>
impl<Sink, T> UnsafeUnpin for SocketUpdate<Sink, T>where
Sink: UnsafeUnpin,
T: UnsafeUnpin,
impl<Sink, T> UnwindSafe for SocketUpdate<Sink, T>where
Sink: UnwindSafe,
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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