pub struct Budget {
pub deadline: Option<Duration>,
pub poll_quota: u32,
pub cost_quota: Option<u64>,
pub priority: u8,
}Expand description
A budget for cancellation/deadline/priority propagation.
This is a product lattice with mixed meet/join semantics:
- resource constraints tighten by
min(deadline/poll/cost) - priority propagates by
max
Fields§
§deadline: Option<Duration>§poll_quota: u32§cost_quota: Option<u64>§priority: u8Implementations§
Source§impl Budget
impl Budget
Sourcepub const INFINITE: Self
pub const INFINITE: Self
No constraints (identity for Self::meet).
pub const fn with_deadline(self, deadline: Duration) -> Self
pub const fn with_priority(self, priority: u8) -> Self
pub const fn with_poll_quota(self, poll_quota: u32) -> Self
pub const fn with_cost_quota(self, cost_quota: u64) -> Self
Trait Implementations§
impl Copy for Budget
impl Eq for Budget
impl StructuralPartialEq for Budget
Auto Trait Implementations§
impl Freeze for Budget
impl RefUnwindSafe for Budget
impl Send for Budget
impl Sync for Budget
impl Unpin for Budget
impl UnsafeUnpin for Budget
impl UnwindSafe for Budget
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).