pub type NewBlockNotifications = UnboundedReceiver<NewBlockNotification>;
Expand description
Type alias for a receiver that receives NewBlockNotification
Aliased Type§
struct NewBlockNotifications { /* private fields */ }
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes
Implementations
§impl<T> UnboundedReceiver<T>
impl<T> UnboundedReceiver<T>
pub fn close(&mut self)
pub fn close(&mut self)
Closes the receiving half of a channel, without dropping it.
This prevents any further messages from being sent on the channel while still enabling the receiver to drain messages that are buffered.
pub fn try_next(&mut self) -> Result<Option<T>, TryRecvError>
pub fn try_next(&mut self) -> Result<Option<T>, TryRecvError>
Tries to receive the next message without notifying a context if empty.
It is not recommended to call this function from inside of a future, only when you’ve otherwise arranged to be notified when the channel is no longer empty.
This function returns:
Ok(Some(t))
when message is fetchedOk(None)
when channel is closed and no messages left in the queueErr(e)
when there are no messages available, but channel is not yet closed
Trait Implementations
§impl<T> FusedStream for UnboundedReceiver<T>
impl<T> FusedStream for UnboundedReceiver<T>
§fn is_terminated(&self) -> bool
fn is_terminated(&self) -> bool
true
if the stream should no longer be polled.