pub struct ResourceAccounting { /* private fields */ }Expand description
Accounting for one resource dimension.
Implementations§
Source§impl ResourceAccounting
impl ResourceAccounting
Sourcepub const fn metered(limit: u64, consumed: u64) -> Self
pub const fn metered(limit: u64, consumed: u64) -> Self
Records a metered resource. consumed may exceed limit by the single
observation that revealed a boundary crossing.
Sourcepub const fn observed(consumed: u64) -> Self
pub const fn observed(consumed: u64) -> Self
Records observed consumption for a dimension without claiming that the runtime enforced a limit.
Sourcepub const fn mode(&self) -> ResourceAccountingMode
pub const fn mode(&self) -> ResourceAccountingMode
Returns the accounting mode.
Trait Implementations§
Source§impl Clone for ResourceAccounting
impl Clone for ResourceAccounting
Source§fn clone(&self) -> ResourceAccounting
fn clone(&self) -> ResourceAccounting
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 moreSource§impl Debug for ResourceAccounting
impl Debug for ResourceAccounting
Source§impl<'de> Deserialize<'de> for ResourceAccounting
impl<'de> Deserialize<'de> for ResourceAccounting
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ResourceAccounting
Source§impl PartialEq for ResourceAccounting
impl PartialEq for ResourceAccounting
Source§impl Serialize for ResourceAccounting
impl Serialize for ResourceAccounting
impl StructuralPartialEq for ResourceAccounting
Auto Trait Implementations§
impl Freeze for ResourceAccounting
impl RefUnwindSafe for ResourceAccounting
impl Send for ResourceAccounting
impl Sync for ResourceAccounting
impl Unpin for ResourceAccounting
impl UnsafeUnpin for ResourceAccounting
impl UnwindSafe for ResourceAccounting
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.