pub struct Cx<'poll, 'env, R> {
pub resources: &'poll mut R,
/* private fields */
}Expand description
The poll context for tasks.
Fields§
§resources: &'poll mut RImplementations§
Source§impl<'poll, 'env, R> Cx<'poll, 'env, R>
impl<'poll, 'env, R> Cx<'poll, 'env, R>
pub fn id(&self) -> TaskId
pub fn wake(&self, id: TaskId)
pub fn wake_self(&self)
pub fn wake_sender(&self) -> WakeSender
pub fn subscribe_to_finish(&mut self, target_task: TaskId)
pub fn spawn_later_named<T>(&mut self, name: impl Into<String>, task: T)where
T: ScopedTask<'env, R> + 'env,
pub fn task_state(&mut self, id: TaskId) -> TaskState
pub fn wait_readable(&mut self, token: usize)
pub fn sleep_until(&mut self, deadline: Instant)
pub fn sleep_for(&mut self, dur: Duration)
pub fn is_cancelled(&self) -> bool
Sourcepub fn cancel(&mut self, task: TaskId)
pub fn cancel(&mut self, task: TaskId)
Best-effort cancel (no additional escalation beyond whatever the scope defaults are).
pub fn cancel_with_reason(&mut self, task: TaskId, reason: CancelReason)
pub fn cancel_escalate_with(&mut self, task: TaskId, esc: CancelEscalation)
pub fn cancel_escalate_with_reason( &mut self, task: TaskId, esc: CancelEscalation, reason: CancelReason, )
Auto Trait Implementations§
impl<'poll, 'env, R> Freeze for Cx<'poll, 'env, R>
impl<'poll, 'env, R> !RefUnwindSafe for Cx<'poll, 'env, R>
impl<'poll, 'env, R> !Send for Cx<'poll, 'env, R>
impl<'poll, 'env, R> !Sync for Cx<'poll, 'env, R>
impl<'poll, 'env, R> Unpin for Cx<'poll, 'env, R>
impl<'poll, 'env, R> UnsafeUnpin for Cx<'poll, 'env, R>
impl<'poll, 'env, R> !UnwindSafe for Cx<'poll, 'env, R>
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