Struct jsonrpc_pubsub::typed::Sink
source · [−]pub struct Sink<T, E = Error> { /* private fields */ }
Expand description
Subscriber sink.
Implementations
sourceimpl<T: Serialize, E: Serialize> Sink<T, E>
impl<T: Serialize, E: Serialize> Sink<T, E>
sourcepub fn notify(&self, val: Result<T, E>) -> SinkResult
pub fn notify(&self, val: Result<T, E>) -> SinkResult
Sends a notification to the subscriber.
Trait Implementations
sourceimpl<T: Serialize, E: Serialize> Sink for Sink<T, E>
impl<T: Serialize, E: Serialize> Sink for Sink<T, E>
type SinkError = TransportError
type SinkError = TransportError
The type of value produced by the sink when an error occurs.
sourcefn start_send(
&mut self,
item: Self::SinkItem
) -> StartSend<Self::SinkItem, Self::SinkError>
fn start_send(
&mut self,
item: Self::SinkItem
) -> StartSend<Self::SinkItem, Self::SinkError>
Begin the process of sending a value to the sink. Read more
sourcefn poll_complete(&mut self) -> Poll<(), Self::SinkError>
fn poll_complete(&mut self) -> Poll<(), Self::SinkError>
Flush all output from this sink, if necessary. Read more
sourcefn close(&mut self) -> Poll<(), Self::SinkError>
fn close(&mut self) -> Poll<(), Self::SinkError>
A method to indicate that no more values will ever be pushed into this sink. Read more
sourcefn wait(self) -> Wait<Self>
fn wait(self) -> Wait<Self>
Creates a new object which will produce a synchronous sink. Read more
sourcefn with<U, F, Fut>(self, f: F) -> With<Self, U, F, Fut> where
F: FnMut(U) -> Fut,
Fut: IntoFuture<Item = Self::SinkItem>,
<Fut as IntoFuture>::Error: From<Self::SinkError>,
fn with<U, F, Fut>(self, f: F) -> With<Self, U, F, Fut> where
F: FnMut(U) -> Fut,
Fut: IntoFuture<Item = Self::SinkItem>,
<Fut as IntoFuture>::Error: From<Self::SinkError>,
Composes a function in front of the sink. Read more
sourcefn with_flat_map<U, F, St>(self, f: F) -> WithFlatMap<Self, U, F, St> where
F: FnMut(U) -> St,
St: Stream<Item = Self::SinkItem, Error = Self::SinkError>,
fn with_flat_map<U, F, St>(self, f: F) -> WithFlatMap<Self, U, F, St> where
F: FnMut(U) -> St,
St: Stream<Item = Self::SinkItem, Error = Self::SinkError>,
Composes a function in front of the sink. Read more
sourcefn sink_map_err<F, E>(self, f: F) -> SinkMapErr<Self, F> where
F: FnOnce(Self::SinkError) -> E,
fn sink_map_err<F, E>(self, f: F) -> SinkMapErr<Self, F> where
F: FnOnce(Self::SinkError) -> E,
Transforms the error returned by the sink.
sourcefn sink_from_err<E>(self) -> SinkFromErr<Self, E> where
E: From<Self::SinkError>,
fn sink_from_err<E>(self) -> SinkFromErr<Self, E> where
E: From<Self::SinkError>,
Map this sink’s error to any error implementing From
for this sink’s
Error
, returning a new sink. Read more
sourcefn buffer(self, amt: usize) -> Buffer<Self>
fn buffer(self, amt: usize) -> Buffer<Self>
Adds a fixed-size buffer to the current sink. Read more
sourcefn fanout<S>(self, other: S) -> Fanout<Self, S> where
S: Sink<SinkItem = Self::SinkItem, SinkError = Self::SinkError>,
Self::SinkItem: Clone,
fn fanout<S>(self, other: S) -> Fanout<Self, S> where
S: Sink<SinkItem = Self::SinkItem, SinkError = Self::SinkError>,
Self::SinkItem: Clone,
Fanout items to multiple sinks. Read more
sourcefn flush(self) -> Flush<Self>
fn flush(self) -> Flush<Self>
A future that completes when the sink has finished processing all pending requests. Read more
Auto Trait Implementations
impl<T, E = Error> !RefUnwindSafe for Sink<T, E>
impl<T, E> Send for Sink<T, E> where
E: Send,
T: Send,
impl<T, E> Sync for Sink<T, E> where
E: Sync,
T: Sync,
impl<T, E> Unpin for Sink<T, E> where
E: Unpin,
T: Unpin,
impl<T, E = Error> !UnwindSafe for Sink<T, E>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more