Skip to main content

Released

Struct Released 

Source
pub struct Released<B = Vec<u8>> { /* private fields */ }
Expand description

The buffer of a TcpStream::write_zero_copy, as a future that resolves to it once the kernel let go of every byte. For a send the kernel did not copy, that is once the peer acknowledged the bytes, which may be long after the write ended.

It may be polled from any thread, or dropped: the buffer is then dropped once the kernel let go of it, never before. A write the kernel copied gives one that is ready at once.

The buffer comes back even after the runtime that sent it shut down: a keeper on the blocking pool takes over the completions of its worker’s ring then, and lets go of the ring once the kernel let go of every buffer.

Trait Implementations§

Source§

impl<B> Debug for Released<B>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<B> Future for Released<B>
where B: IoBuf,

Source§

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

The buffer once the kernel let go of it. Polled again after that, an empty buffer.

Source§

type Output = B

The type of value produced on completion.

Auto Trait Implementations§

§

impl<B = Vec<u8>> !RefUnwindSafe for Released<B>

§

impl<B = Vec<u8>> !UnwindSafe for Released<B>

§

impl<B> Freeze for Released<B>

§

impl<B> Send for Released<B>

§

impl<B> Sync for Released<B>

§

impl<B> Unpin for Released<B>

§

impl<B> UnsafeUnpin for Released<B>

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
§

impl<T> MaybeSend for T
where T: Send + ?Sized,

Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.