Skip to main content

CloseFuture

Struct CloseFuture 

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

Future that closes an AsyncClose output.

§Panics

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

§Type Parameters

  • 'a: Lifetime of the borrowed output.
  • O: Asynchronous output type.

Implementations§

Source§

impl<'a, O> CloseFuture<'a, O>
where O: AsyncClose + ?Sized,

Source

pub const fn new(output: Pin<&'a mut O>) -> Self

Creates a close future from a pinned output.

§Parameters
  • output: Pinned asynchronous output.
§Returns

Returns a future representing the close operation.

Trait Implementations§

Source§

impl<O> Future for CloseFuture<'_, O>
where O: AsyncClose + ?Sized,

Source§

type Output = Result<(), Error>

Result produced when the close operation becomes ready.

Source§

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

Polls the close operation.

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

Returns Poll::Pending while closing is incomplete. A ready result indicates whether closing succeeded.

§Errors

Returns an I/O error reported by the output. Invalid asynchronous error kinds are normalized to std::io::ErrorKind::InvalidData.

§Panics

Panics when polled after returning Poll::Ready.

Auto Trait Implementations§

§

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

§

impl<'a, O> Freeze for CloseFuture<'a, O>
where Pin<&'a mut O>: Freeze, O: ?Sized,

§

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

§

impl<'a, O> Send for CloseFuture<'a, O>
where Pin<&'a mut O>: Send, O: ?Sized,

§

impl<'a, O> Sync for CloseFuture<'a, O>
where Pin<&'a mut O>: Sync, O: ?Sized,

§

impl<'a, O> Unpin for CloseFuture<'a, O>
where Pin<&'a mut O>: Unpin, O: ?Sized,

§

impl<'a, O> UnsafeUnpin for CloseFuture<'a, O>

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.