pub struct Sender<T: Send + 'static, E: Send + 'static> { /* private fields */ }Expand description
The sending half of Stream::pair(). Can only be owned by a single task at
a time.
Implementations§
Source§impl<T: Send + 'static, E: Send + 'static> Sender<T, E>
impl<T: Send + 'static, E: Send + 'static> Sender<T, E>
Sourcepub fn send(self, val: T) -> BusySender<T, E>
pub fn send(self, val: T) -> BusySender<T, E>
Attempts to send a value to its Stream. Consumes self and returns a
future representing the operation completing successfully and interest
in the next value being expressed.
Trait Implementations§
Source§impl<T: Send + 'static, E: Send + 'static> Async for Sender<T, E>
impl<T: Send + 'static, E: Send + 'static> Async for Sender<T, E>
type Value = Sender<T, E>
type Error = ()
type Cancel = Receipt<Sender<T, E>>
Source§fn poll(self) -> Result<AsyncResult<Sender<T, E>, ()>, Sender<T, E>>
fn poll(self) -> Result<AsyncResult<Sender<T, E>, ()>, Sender<T, E>>
Get the underlying value if present
Source§fn ready<F: FnOnce(Sender<T, E>) + Send + 'static>(
self,
f: F,
) -> Receipt<Sender<T, E>>
fn ready<F: FnOnce(Sender<T, E>) + Send + 'static>( self, f: F, ) -> Receipt<Sender<T, E>>
Invokes the given function when the Async instance is ready to be
consumed.
Source§fn expect(self) -> AsyncResult<Self::Value, Self::Error>
fn expect(self) -> AsyncResult<Self::Value, Self::Error>
Get the underlying value if present, panic otherwise
Source§fn await(self) -> AsyncResult<Self::Value, Self::Error>
fn await(self) -> AsyncResult<Self::Value, Self::Error>
Blocks the thread until the async value is complete and returns the
result.
Source§fn and<U: Async<Error = Self::Error>>(
self,
next: U,
) -> Future<U::Value, Self::Error>
fn and<U: Async<Error = Self::Error>>( self, next: U, ) -> Future<U::Value, Self::Error>
This method returns a future whose completion value depends on the
completion value of the original future. Read more
Source§fn and_then<F, U: Async<Error = Self::Error>>(
self,
f: F,
) -> Future<U::Value, Self::Error>
fn and_then<F, U: Async<Error = Self::Error>>( self, f: F, ) -> Future<U::Value, Self::Error>
This method returns a future whose completion value depends on the
completion value of the original future. Read more
Auto Trait Implementations§
impl<T, E> Freeze for Sender<T, E>
impl<T, E> !RefUnwindSafe for Sender<T, E>
impl<T, E> Send for Sender<T, E>
impl<T, E> !Sync for Sender<T, E>
impl<T, E> Unpin for Sender<T, E>
impl<T, E> !UnwindSafe for Sender<T, E>
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
Mutably borrows from an owned value. Read more