pub struct Context<'poll, 'd: 'poll> { /* private fields */ }Implementations§
Source§impl<'poll, 'd> Context<'poll, 'd>
impl<'poll, 'd> Context<'poll, 'd>
Sourcepub fn new(
target: Target<'d>,
work: Work<'poll, 'd>,
driver: &'poll mut Local<'d>,
) -> Self
pub fn new( target: Target<'d>, work: Work<'poll, 'd>, driver: &'poll mut Local<'d>, ) -> Self
Creates one poll context for the supplied root and work.
pub fn admitted<'call, 'turn>(
&'call mut self,
_permit: Permit<'turn, 'd>,
) -> Admission<'call, 'poll, 'd>where
'turn: 'poll,
pub const fn waker(&self) -> Waker<'d>
Sourcepub fn root_waker(&self) -> RootWaker<'d>
pub fn root_waker(&self) -> RootWaker<'d>
Returns the exact driver-owned root carried through this poll tree. It can own a persistent scheduler whose members outlive child adapters.
Sourcepub fn completion(&self) -> Waker<'d>
pub fn completion(&self) -> Waker<'d>
Returns a persistent wake capability for this poll target.
pub fn work(&self) -> Work<'poll, 'd>
pub fn driver(&mut self) -> &mut Local<'d>
Sourcepub fn poll<'call, F>(
&'call mut self,
fiber: Pin<&'call mut Task<F>>,
) -> Poll<F::Output>where
F: Fiber<'d>,
pub fn poll<'call, F>(
&'call mut self,
fiber: Pin<&'call mut Task<F>>,
) -> Poll<F::Output>where
F: Fiber<'d>,
Polls a live child with one credit, or returns Pending after completion.
Exhaustion reactivates the current wake target and returns Pending.
Sourcepub fn try_poll<'call, F>(
&'call mut self,
fiber: Pin<&'call mut Task<F>>,
) -> PollResult<F::Output>where
F: Fiber<'d>,
pub fn try_poll<'call, F>(
&'call mut self,
fiber: Pin<&'call mut Task<F>>,
) -> PollResult<F::Output>where
F: Fiber<'d>,
Polls a live child with one credit; Exhausted reactivates its wake target.
A completed task returns Polled(Pending) without consuming credit.
Sourcepub fn try_continue(&self) -> Continue<'poll, 'd>
pub fn try_continue(&self) -> Continue<'poll, 'd>
Reserves one additional application credit for continued inline work.
Exhaustion requeues the current fiber before returning Exhausted.
pub fn region_token(&mut self) -> &mut Token<Identity<'d>>
pub fn wake(&self)
pub fn into_requeue(self) -> Requeue
Trait Implementations§
Auto Trait Implementations§
impl<'poll, 'd> !Freeze for Context<'poll, 'd>
impl<'poll, 'd> !RefUnwindSafe for Context<'poll, 'd>
impl<'poll, 'd> !Send for Context<'poll, 'd>
impl<'poll, 'd> !Sync for Context<'poll, 'd>
impl<'poll, 'd> !UnwindSafe for Context<'poll, 'd>
impl<'poll, 'd> Forget for Context<'poll, 'd>
impl<'poll, 'd> Move for Context<'poll, 'd>
impl<'poll, 'd> Unpin for Context<'poll, 'd>
impl<'poll, 'd> UnsafeUnpin for Context<'poll, 'd>where
Root<'d, Shared<Context<Receive>>>: UnsafeUnpin,
PhantomData<(fn(&'d ()) -> &'d (), ThreadBound)>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
PhantomData<*mut ()>: UnsafeUnpin,
&'poll Core<'d>: UnsafeUnpin,
&'poll mut Local<'d>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more