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) -> ResourceAccounting
pub const fn metered(limit: u64, consumed: u64) -> ResourceAccounting
Records a metered resource. consumed may exceed limit by the single
observation that revealed a boundary crossing.
Sourcepub const fn observed(consumed: u64) -> ResourceAccounting
pub const fn observed(consumed: u64) -> ResourceAccounting
Records observed consumption for a dimension without claiming that the runtime enforced a limit.
Sourcepub const fn unmetered() -> ResourceAccounting
pub const fn unmetered() -> ResourceAccounting
Records that the runtime did not meter this dimension.
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<ResourceAccounting, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ResourceAccounting, <__D as Deserializer<'de>>::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
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ResourceAccounting
Source§impl TryFrom<ResourceAccountingWire> for ResourceAccounting
impl TryFrom<ResourceAccountingWire> for ResourceAccounting
Source§type Error = RunReportError
type Error = RunReportError
The type returned in the event of a conversion error.
Source§fn try_from(
value: ResourceAccountingWire,
) -> Result<ResourceAccounting, <ResourceAccounting as TryFrom<ResourceAccountingWire>>::Error>
fn try_from( value: ResourceAccountingWire, ) -> Result<ResourceAccounting, <ResourceAccounting as TryFrom<ResourceAccountingWire>>::Error>
Performs the conversion.
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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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.§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