[−][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 all receivers have been dropped. If the channel is bounded and is full, the returned future will yield to the async runtime.
pub fn into_send_async(self, item: T) -> SendFuture<'static, 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>>;
Convert this sender into a future that asynchronously sends a single message into the channel, returning an error if all receivers have been dropped. If the channel is bounded and is full, this future will yield to the async runtime.
pub fn sink(&self) -> SendSink<'_, T>
[src]
Create an asynchronous sink that uses this sender to asynchronously send messages into the channel. The sender will continue to be usable after the sink has been dropped.
pub fn into_sink(self) -> SendSink<'static, T>
[src]
Convert this sender into a sink that allows asynchronously sending messages into the channel.
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 all
receivers have 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 all receivers have been dropped. If the channel is bounded and is full, this method will block until space is available or all receivers have been dropped.
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 all receivers have been dropped or the deadline has passed. If the channel is bounded and is full, this method will block until space is available, the deadline is reached, or all receivers have been dropped.
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 all receivers have been dropped or the timeout has expired. If the channel is bounded and is full, this method will block until space is available, the timeout has expired, or all receivers have been dropped.
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]
pub 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.
pub 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,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,