Skip to main content

Admission

Struct Admission 

Source
pub struct Admission<'call, 'turn, 'd: 'turn> { /* private fields */ }
Expand description

One admitted child descent, retaining the original poll context. Consuming it transfers the parent’s credit to a task that owns completion.

Implementations§

Source§

impl<'call, 'turn, 'd: 'turn> Admission<'call, 'turn, 'd>

Source

pub fn context(&mut self) -> &mut Context<'turn, 'd>

Borrows the context for setup before the admitted child descent.

Source

pub fn poll<F: Fiber<'d>>( self, fiber: Pin<&mut Task<F>>, ) -> (Poll<F::Output>, &'call mut Context<'turn, 'd>)

Transfers the existing credit exactly once and returns the context for subsequent work. A completed task remains pending without repolling its former fiber; additional child polls through the context pay a credit.

Source

pub fn poll_next<S: Stream<'d>>( self, stream: Pin<&mut Task<S>>, ) -> (Poll<Option<S::Item>>, &'call mut Context<'turn, 'd>)

Transfers the existing credit to one child stream and returns the same context. End drops the child; later admitted calls return Ready(None) without polling it again.

Source§

impl<'call, 'turn, 'd: 'turn> Admission<'call, 'turn, 'd>

Source

pub unsafe fn invoke<F: Fiber<'d>>( self, fiber: Pin<&mut F>, ) -> (Poll<F::Output>, &'call mut Context<'turn, 'd>)

§Safety

Own the unfinished pinned fiber and drop it before exposing its Ready output. Delegation may return only to the enclosing owner that performs that drop.

Source

pub unsafe fn advance<S: Stream<'d>>( self, stream: Pin<&mut S>, ) -> Poll<Option<S::Item>>

§Safety

Retain the original pinned stream until EOF, then end polling and drop it.

Source

pub unsafe fn budgeted<F: Fiber<'d>>( fiber: Pin<&mut F>, context: &'call mut Context<'turn, 'd>, ) -> Poll<F::Output>

§Safety

Own the unfinished final Pin and drop it on Ready before output use. Delegation may return only to the enclosing owner that performs that drop.

Auto Trait Implementations§

§

impl<'call, 'turn, 'd> !RefUnwindSafe for Admission<'call, 'turn, 'd>

§

impl<'call, 'turn, 'd> !Send for Admission<'call, 'turn, 'd>

§

impl<'call, 'turn, 'd> !Sync for Admission<'call, 'turn, 'd>

§

impl<'call, 'turn, 'd> !UnwindSafe for Admission<'call, 'turn, 'd>

§

impl<'call, 'turn, 'd> Forget for Admission<'call, 'turn, 'd>

§

impl<'call, 'turn, 'd> Freeze for Admission<'call, 'turn, 'd>
where &'call mut Context<'turn, 'd>: Freeze,

§

impl<'call, 'turn, 'd> Move for Admission<'call, 'turn, 'd>

§

impl<'call, 'turn, 'd> Unpin for Admission<'call, 'turn, 'd>
where &'call mut Context<'turn, 'd>: Unpin,

§

impl<'call, 'turn, 'd> UnsafeUnpin for Admission<'call, 'turn, 'd>
where &'call mut Context<'turn, 'd>: UnsafeUnpin,

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<L, R> Convert<Either<L, R>, 1> for L

Source§

fn into(self) -> Either<L, R>

Source§

unsafe fn take_into(source: *mut Self, place: &mut MaybeUninit<T>)
where Self: Sized,

Safety Read more
Source§

impl<L, R> Convert<Either<L, R>, 2> for R

Source§

fn into(self) -> Either<L, R>

Source§

unsafe fn take_into(source: *mut Self, place: &mut MaybeUninit<T>)
where Self: Sized,

Safety Read more
Source§

impl<T> Convert<T> for T

Source§

fn into(self) -> T

Source§

unsafe fn take_into(source: *mut Self, place: &mut MaybeUninit<T>)
where Self: Sized,

Safety 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<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.