Skip to main content

WriteFuture

Struct WriteFuture 

Source
pub struct WriteFuture<'a, O>
where O: AsyncOutput + ?Sized,
{ /* private fields */ }
Expand description

Future for one AsyncOutput write operation.

§Panics

Future::poll panics when called again after this future has returned Poll::Ready.

§Type Parameters

  • 'a: Shared lifetime of the output borrow and source slice.
  • O: Asynchronous output type.

Implementations§

Source§

impl<'a, O> WriteFuture<'a, O>
where O: AsyncOutput + ?Sized,

Source

pub const fn new(output: Pin<&'a mut O>, input: &'a [O::Item]) -> Self

Creates a write future from a pinned output.

§Parameters
  • output: Pinned asynchronous output.
  • input: Source storage.
§Returns

Returns a future representing one write operation.

Trait Implementations§

Source§

impl<O> Future for WriteFuture<'_, O>
where O: AsyncOutput + ?Sized,

Source§

type Output = Result<usize, Error>

Item count produced when the write becomes ready.

Source§

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>

Polls the write operation.

§Parameters
  • cx: Task context used to register a wake-up.
§Returns

Returns Poll::Pending when the output is not ready. A ready success contains the number of items accepted.

§Errors

Returns an I/O error reported by the output.

§Panics

Panics when polled after returning Poll::Ready.

Auto Trait Implementations§

§

impl<'a, O> !UnwindSafe for WriteFuture<'a, O>

§

impl<'a, O> Freeze for WriteFuture<'a, O>
where Pin<&'a mut O>: Freeze, &'a [<O as AsyncOutput>::Item]: Freeze, O: ?Sized,

§

impl<'a, O> RefUnwindSafe for WriteFuture<'a, O>

§

impl<'a, O> Send for WriteFuture<'a, O>
where Pin<&'a mut O>: Send, &'a [<O as AsyncOutput>::Item]: Send, O: ?Sized,

§

impl<'a, O> Sync for WriteFuture<'a, O>
where Pin<&'a mut O>: Sync, &'a [<O as AsyncOutput>::Item]: Sync, O: ?Sized,

§

impl<'a, O> Unpin for WriteFuture<'a, O>
where Pin<&'a mut O>: Unpin, &'a [<O as AsyncOutput>::Item]: Unpin, O: ?Sized,

§

impl<'a, O> UnsafeUnpin for WriteFuture<'a, O>
where Pin<&'a mut O>: UnsafeUnpin, &'a [<O as AsyncOutput>::Item]: UnsafeUnpin, O: ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<F> IntoFuture for F
where F: Future,

Source§

type Output = <F as Future>::Output

The output that the future will produce on completion.
Source§

type IntoFuture = F

Which kind of future are we turning this into?
Source§

fn into_future(self) -> <F as IntoFuture>::IntoFuture

Creates a future from a value. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.