pub struct UnboundedMeteredSender<T> { /* private fields */ }
Expand description
The sender component, tracking the number of items sent across it.
Implementations§
source§impl<T> UnboundedMeteredSender<T>
impl<T> UnboundedMeteredSender<T>
sourcepub fn unbounded_send(
&self,
msg: T,
) -> Result<(), TrySendError<MaybeTimeOfFlight<T>>>
pub fn unbounded_send( &self, msg: T, ) -> Result<(), TrySendError<MaybeTimeOfFlight<T>>>
Attempt to send message or fail immediately.
Methods from Deref<Target = Sender<MaybeTimeOfFlight<T>>>§
sourcepub fn poll_ready(&self, _: &mut Context<'_>) -> Poll<Result<(), SendError>>
pub fn poll_ready(&self, _: &mut Context<'_>) -> Poll<Result<(), SendError>>
Check if the channel is ready to receive a message.
sourcepub fn is_closed(&self) -> bool
pub fn is_closed(&self) -> bool
Returns whether this channel is closed without needing a context.
sourcepub fn close_channel(&self)
pub fn close_channel(&self)
Closes this channel from the sender side, preventing any new messages.
sourcepub fn disconnect(&mut self)
pub fn disconnect(&mut self)
Disconnects this sender from the channel, closing it if there are no more senders left.
sourcepub fn start_send(&mut self, msg: T) -> Result<(), SendError>
pub fn start_send(&mut self, msg: T) -> Result<(), SendError>
Send a message on the channel.
This method should only be called after poll_ready
has been used to
verify that the channel is ready to receive a message.
sourcepub fn unbounded_send(&self, msg: T) -> Result<(), TrySendError<T>>
pub fn unbounded_send(&self, msg: T) -> Result<(), TrySendError<T>>
Sends a message along this channel.
This is an unbounded sender, so this function differs from Sink::send
by ensuring the return type reflects that the channel is always ready to
receive messages.
sourcepub fn same_receiver(&self, other: &UnboundedSender<T>) -> bool
pub fn same_receiver(&self, other: &UnboundedSender<T>) -> bool
Returns whether the senders send to the same receiver.
sourcepub fn is_connected_to(&self, receiver: &UnboundedReceiver<T>) -> bool
pub fn is_connected_to(&self, receiver: &UnboundedReceiver<T>) -> bool
Returns whether the sender send to this receiver.
sourcepub fn hash_receiver<H>(&self, hasher: &mut H)where
H: Hasher,
pub fn hash_receiver<H>(&self, hasher: &mut H)where
H: Hasher,
Hashes the receiver into the provided hasher
Trait Implementations§
source§impl<T> Clone for UnboundedMeteredSender<T>
impl<T> Clone for UnboundedMeteredSender<T>
source§impl<T: Debug> Debug for UnboundedMeteredSender<T>
impl<T: Debug> Debug for UnboundedMeteredSender<T>
source§impl<T> Deref for UnboundedMeteredSender<T>
impl<T> Deref for UnboundedMeteredSender<T>
§type Target = UnboundedSender<MaybeTimeOfFlight<T>>
type Target = UnboundedSender<MaybeTimeOfFlight<T>>
Auto Trait Implementations§
impl<T> Freeze for UnboundedMeteredSender<T>
impl<T> !RefUnwindSafe for UnboundedMeteredSender<T>
impl<T> Send for UnboundedMeteredSender<T>where
T: Send,
impl<T> Sync for UnboundedMeteredSender<T>where
T: Send,
impl<T> Unpin for UnboundedMeteredSender<T>
impl<T> !UnwindSafe for UnboundedMeteredSender<T>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)