pub struct ResourceBudgetTree { /* private fields */ }Expand description
Represents resource budget tree.
Implementations§
Source§impl ResourceBudgetTree
impl ResourceBudgetTree
Sourcepub fn new(
name: impl Into<String>,
limit: BudgetLimit,
) -> Result<Self, RuntimeContractViolation>
pub fn new( name: impl Into<String>, limit: BudgetLimit, ) -> Result<Self, RuntimeContractViolation>
Creates a new ResourceBudgetTree.
§Errors
Returns a contract violation when the root name is blank or malformed, or when its budget limit is invalid.
Sourcepub fn with_clock(
name: impl Into<String>,
limit: BudgetLimit,
clock: Arc<dyn MonotonicClock>,
) -> Result<Self, RuntimeContractViolation>
pub fn with_clock( name: impl Into<String>, limit: BudgetLimit, clock: Arc<dyn MonotonicClock>, ) -> Result<Self, RuntimeContractViolation>
Creates a tree with an injected monotonic clock.
§Errors
Returns a contract violation when the root name is blank or malformed, or when its budget limit is invalid.
Sourcepub fn with_clock_and_key_capacity(
name: impl Into<String>,
limit: BudgetLimit,
clock: Arc<dyn MonotonicClock>,
max_entries: usize,
) -> Result<Self, RuntimeContractViolation>
pub fn with_clock_and_key_capacity( name: impl Into<String>, limit: BudgetLimit, clock: Arc<dyn MonotonicClock>, max_entries: usize, ) -> Result<Self, RuntimeContractViolation>
Creates a tree whose dynamic key registry holds at most max_entries
names.
§Errors
Returns a contract violation when the root name is blank or malformed, or when its budget limit is invalid.
Sourcepub fn root(&self) -> ResourceBudget
pub fn root(&self) -> ResourceBudget
Returns the root.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ResourceBudgetTree
impl !UnwindSafe for ResourceBudgetTree
impl Forget for ResourceBudgetTree
impl Freeze for ResourceBudgetTreewhere
*const ArcInner<BudgetNode> is !null: Freeze,
PhantomData<ArcInner<BudgetNode>>: Freeze,
*const ArcInner<[Arc<BudgetNode>]> is !null: Freeze,
PhantomData<ArcInner<[Arc<BudgetNode>]>>: Freeze,
*const ArcInner<CapacitySignal> is !null: Freeze,
PhantomData<ArcInner<CapacitySignal>>: Freeze,
*const ArcInner<DynamicKeyRegistryInner> is !null: Freeze,
PhantomData<ArcInner<DynamicKeyRegistryInner>>: Freeze,
*const ArcInner<[Arc<AdmissionGate>]> is !null: Freeze,
PhantomData<ArcInner<[Arc<AdmissionGate>]>>: Freeze,
impl Move for ResourceBudgetTree
impl Send for ResourceBudgetTree
impl Sync for ResourceBudgetTree
impl Unpin for ResourceBudgetTree
impl UnsafeUnpin for ResourceBudgetTreewhere
*const ArcInner<BudgetNode> is !null: UnsafeUnpin,
PhantomData<ArcInner<BudgetNode>>: UnsafeUnpin,
*const ArcInner<[Arc<BudgetNode>]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[Arc<BudgetNode>]>>: UnsafeUnpin,
*const ArcInner<CapacitySignal> is !null: UnsafeUnpin,
PhantomData<ArcInner<CapacitySignal>>: UnsafeUnpin,
*const ArcInner<DynamicKeyRegistryInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<DynamicKeyRegistryInner>>: UnsafeUnpin,
*const ArcInner<[Arc<AdmissionGate>]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[Arc<AdmissionGate>]>>: UnsafeUnpin,
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