pub struct BackgroundBudget { /* private fields */ }Expand description
Per-realm background budget (§8.1): a sliding-window run cap plus a concurrency ceiling. Cheap to clone; clones share state.
Implementations§
Source§impl BackgroundBudget
impl BackgroundBudget
pub fn new(config: BackgroundBudgetConfig) -> Self
Sourcepub fn set_event_sink(&self, sink: Arc<dyn MemoryEventSink>)
pub fn set_event_sink(&self, sink: Arc<dyn MemoryEventSink>)
Wire the §9.3 timeline sink so guard denials surface on the console alongside the tracing warn. Shared across clones.
Sourcepub fn try_acquire(
&self,
realm: &str,
stage: &str,
) -> Result<BudgetPermit, BudgetDenied>
pub fn try_acquire( &self, realm: &str, stage: &str, ) -> Result<BudgetPermit, BudgetDenied>
Admit one background run for realm, or say loudly why not.
stage is only for the log line.
Trait Implementations§
Source§impl Clone for BackgroundBudget
impl Clone for BackgroundBudget
Source§fn clone(&self) -> BackgroundBudget
fn clone(&self) -> BackgroundBudget
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BackgroundBudget
impl RefUnwindSafe for BackgroundBudget
impl Send for BackgroundBudget
impl Sync for BackgroundBudget
impl Unpin for BackgroundBudget
impl UnsafeUnpin for BackgroundBudget
impl UnwindSafe for BackgroundBudget
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,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more