[−][src]Struct futures::sink::Wait
#[must_use = "sinks do nothing unless used"]pub struct Wait<S> { /* fields omitted */ }
A sink combinator which converts an asynchronous sink to a blocking sink.
Created by the Sink::wait
method, this function transforms any sink into a
blocking version. This is implemented by blocking the current thread when a
sink is otherwise unable to make progress.
Methods
impl<S: Sink> Wait<S>
[src]
impl<S: Sink> Wait<S>
pub fn send(&mut self, value: S::SinkItem) -> Result<(), S::SinkError>
[src]
pub fn send(&mut self, value: S::SinkItem) -> Result<(), S::SinkError>
Sends a value to this sink, blocking the current thread until it's able to do so.
This function will take the value
provided and call the underlying
sink's start_send
function until it's ready to accept the value. If
the function returns NotReady
then the current thread is blocked
until it is otherwise ready to accept the value.
Return value
If Ok(())
is returned then the value
provided was successfully sent
along the sink, and if Err(e)
is returned then an error occurred
which prevented the value from being sent.
pub fn flush(&mut self) -> Result<(), S::SinkError>
[src]
pub fn flush(&mut self) -> Result<(), S::SinkError>
Flushes any buffered data in this sink, blocking the current thread until it's entirely flushed.
This function will call the underlying sink's poll_complete
method
until it returns that it's ready to proceed. If the method returns
NotReady
the current thread will be blocked until it's otherwise
ready to proceed.
pub fn close(&mut self) -> Result<(), S::SinkError>
[src]
pub fn close(&mut self) -> Result<(), S::SinkError>
Close this sink, blocking the current thread until it's entirely closed.
This function will call the underlying sink's close
method
until it returns that it's closed. If the method returns
NotReady
the current thread will be blocked until it's otherwise closed.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more