pub struct Meter {
pub bound: fn() -> Option<u64>,
pub charged: fn(&mut i64, Option<u64>, &mut dyn FnMut()) -> bool,
pub charge: fn(i64),
}Expand description
The host’s allocator meter, through which a node holds each process to the
live-byte bound of the evaluation that spawned it (max_alloc_bytes).
A process is charged what its own slices leave live and the messages
delivered to it, never what its sender or its spawner holds: a message’s
copy belongs to the receiver, and a process’s interpreter and code belong
to the node. Past its bound a process exits
ExitReason::memory_exhausted at the end of the slice that passed it.
Fields§
§bound: fn() -> Option<u64>The bound of the account running now: None when it has none, or the
host counts nothing.
charged: fn(&mut i64, Option<u64>, &mut dyn FnMut()) -> boolRun the closure charged to the account whose live bytes the i64
carries, held to the bound; answers whether it passed the bound.
charge: fn(i64)Charge bytes to the account running now.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Meter
impl RefUnwindSafe for Meter
impl Send for Meter
impl Sync for Meter
impl Unpin for Meter
impl UnsafeUnpin for Meter
impl UnwindSafe for Meter
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