Struct nb_sync::fifo::SendCompletion [−][src]
pub struct SendCompletion<'a, 'b: 'a, T: 'b> { /* fields omitted */ }
Sends a value along a channel.
This is created through Sender::send_with_completion
and provides a poll
function
that can be used directly with the nb
macro await!
, while still allowing the owned T
to be retrieved.
When the application is done using the SendCompletion
it should call the
done
method in order to retrieve the Sender
. At this point, the
original sent value will be returned as well if it was never sent during the lifetime of the
SendCompletion
.
Methods
impl<'a, 'b: 'a, T: 'b> SendCompletion<'a, 'b, T>
[src]
impl<'a, 'b: 'a, T: 'b> SendCompletion<'a, 'b, T>
pub fn poll(&mut self) -> Result<(), !>
[src]
pub fn poll(&mut self) -> Result<(), !>
Attempts to send the value that this completion was created for.
pub fn done(self) -> (Sender<'a, 'b, T>, Option<T>)
[src]
pub fn done(self) -> (Sender<'a, 'b, T>, Option<T>)
Discards this completion, optionally returning the inner value if it wasn't sent.
Auto Trait Implementations
impl<'a, 'b, T> Send for SendCompletion<'a, 'b, T> where
T: Send,
'b: 'a,
impl<'a, 'b, T> Send for SendCompletion<'a, 'b, T> where
T: Send,
'b: 'a,
impl<'a, 'b, T> !Sync for SendCompletion<'a, 'b, T>
impl<'a, 'b, T> !Sync for SendCompletion<'a, 'b, T>