pub struct ExecutionContext { /* private fields */ }Expand description
Execution controls propagated through object resolution and operation dispatch.
Cancellation and deadlines are checked immediately before typed implementation
invocation. Providers also receive the complete context and remain responsible
for enforcing controls while backend work is in progress. resource_budget is
an opaque Host-defined work-unit ceiling; this crate deliberately does not
prescribe an async runtime or accounting mechanism.
Implementations§
Source§impl ExecutionContext
impl ExecutionContext
Sourcepub fn with_cancellation(self, cancellation: CancellationToken) -> Self
pub fn with_cancellation(self, cancellation: CancellationToken) -> Self
Uses cancellation as this call’s cooperative cancellation signal.
Sourcepub fn with_deadline(self, deadline: Instant) -> Self
pub fn with_deadline(self, deadline: Instant) -> Self
Sets the monotonic deadline for this call.
Sourcepub fn with_resource_budget(self, resource_budget: u64) -> Self
pub fn with_resource_budget(self, resource_budget: u64) -> Self
Sets an opaque Host-defined work-unit ceiling for this call.
Sourcepub fn cancellation(&self) -> &CancellationToken
pub fn cancellation(&self) -> &CancellationToken
Returns the shared cooperative cancellation token.
Sourcepub fn resource_budget(&self) -> Option<u64>
pub fn resource_budget(&self) -> Option<u64>
Returns the opaque Host-defined work-unit ceiling, if one was supplied.
Trait Implementations§
Source§impl Clone for ExecutionContext
impl Clone for ExecutionContext
Source§impl Debug for ExecutionContext
impl Debug for ExecutionContext
Auto Trait Implementations§
impl Freeze for ExecutionContext
impl RefUnwindSafe for ExecutionContext
impl Send for ExecutionContext
impl Sync for ExecutionContext
impl Unpin for ExecutionContext
impl UnsafeUnpin for ExecutionContext
impl UnwindSafe for ExecutionContext
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