pub struct TaskScope { /* private fields */ }Expand description
The spending and the records of one phase of one turn.
Implementations§
Source§impl TaskScope
impl TaskScope
Sourcepub fn new(budget: Budget, locale: Locale) -> Self
pub fn new(budget: Budget, locale: Locale) -> Self
A scope bounded by budget, for a turn in locale.
Sourcepub fn with_profiles(self, profiles: TaskProfiles) -> Self
pub fn with_profiles(self, profiles: TaskProfiles) -> Self
Runs this scope’s tasks under profiles instead of the engine’s.
Sourcepub const fn with_effort(self, effort: Effort) -> Self
pub const fn with_effort(self, effort: Effort) -> Self
Labels this scope’s task signals with the turn’s effort.
Sourcepub const fn effort(&self) -> Option<Effort>
pub const fn effort(&self) -> Option<Effort>
The effort this scope’s turn runs at, when it was given one.
Sourcepub fn for_turn(self, turn: impl Into<String>) -> Self
pub fn for_turn(self, turn: impl Into<String>) -> Self
Labels every call of this scope with the turn it belongs to, for a trace or a provider’s own logs to group them.
Sourcepub fn records(&self) -> Vec<TaskRecord>
pub fn records(&self) -> Vec<TaskRecord>
Every call recorded so far, in the order the calls finished.
Sourcepub fn budget_report(&self) -> BudgetReport
pub fn budget_report(&self) -> BudgetReport
What was spent.
Sourcepub fn exhausted(&self) -> Option<BudgetBound>
pub fn exhausted(&self) -> Option<BudgetBound>
The first bound reached, if any.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TaskScope
impl RefUnwindSafe for TaskScope
impl Send for TaskScope
impl Sync for TaskScope
impl Unpin for TaskScope
impl UnsafeUnpin for TaskScope
impl UnwindSafe for TaskScope
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