[−][src]Struct flume::Sender
A transmitting end of a channel.
Implementations
impl<T: Unpin> Sender<T>
[src]
pub fn send_async(&self, item: T) -> SendFuture<'_, T>ⓘNotable traits for SendFuture<'a, T>
impl<'a, T: Unpin> Future for SendFuture<'a, T> type Output = Result<(), SendError<T>>;
[src]
Notable traits for SendFuture<'a, T>
impl<'a, T: Unpin> Future for SendFuture<'a, T> type Output = Result<(), SendError<T>>;
Asynchronously send a value into the channel, returning an error if the channel receiver has been dropped. If the channel is bounded and is full, this method will yield to the async runtime.
pub fn sink(&self) -> SendSink<'_, T>
[src]
Use this channel as an asynchronous item sink.
impl<T> Sender<T>
[src]
pub fn try_send(&self, msg: T) -> Result<(), TrySendError<T>>
[src]
Attempt to send a value into the channel. If the channel is bounded and full, or the
receiver has been dropped, an error is returned. If the channel associated with this
sender is unbounded, this method has the same behaviour as Sender::send
.
pub fn send(&self, msg: T) -> Result<(), SendError<T>>
[src]
Send a value into the channel, returning an error if the channel receiver has been dropped. If the channel is bounded and is full, this method will block.
pub fn send_deadline(
&self,
msg: T,
deadline: Instant
) -> Result<(), SendTimeoutError<T>>
[src]
&self,
msg: T,
deadline: Instant
) -> Result<(), SendTimeoutError<T>>
Send a value into the channel, returning an error if the channel receiver has been dropped or the deadline has passed. If the channel is bounded and is full, this method will block.
pub fn send_timeout(
&self,
msg: T,
dur: Duration
) -> Result<(), SendTimeoutError<T>>
[src]
&self,
msg: T,
dur: Duration
) -> Result<(), SendTimeoutError<T>>
Send a value into the channel, returning an error if the channel receiver has been dropped or the timeout has expired. If the channel is bounded and is full, this method will block.
pub fn is_disconnected(&self) -> bool
[src]
Returns true if all receivers for this channel have been dropped.
pub fn is_empty(&self) -> bool
[src]
Returns true if the channel is empty. Note: Zero-capacity channels are always empty.
pub fn is_full(&self) -> bool
[src]
Returns true if the channel is full. Note: Zero-capacity channels are always full.
pub fn len(&self) -> usize
[src]
Returns the number of messages in the channel
pub fn capacity(&self) -> Option<usize>
[src]
If the channel is bounded, returns its capacity.
Trait Implementations
impl<T> Clone for Sender<T>
[src]
fn clone(&self) -> Self
[src]
Clone this sender. Sender
acts as a handle to the ending a channel. Remaining channel
contents will only be cleaned up when all senders and the receiver have been dropped.
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> Debug for Sender<T>
[src]
impl<T> Drop for Sender<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for Sender<T>
impl<T> Send for Sender<T> where
T: Send,
T: Send,
impl<T> Sync for Sender<T> where
T: Send,
T: Send,
impl<T> Unpin for Sender<T>
impl<T> !UnwindSafe for Sender<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,