pub struct AccountsDataMeter { /* private fields */ }
Expand description
Meter and track the amount of available accounts data space
Implementations
sourceimpl AccountsDataMeter
impl AccountsDataMeter
sourcepub fn maximum(&self) -> u64
pub fn maximum(&self) -> u64
Return the maximum amount of accounts data space that can be used (in bytes)
sourcepub fn delta(&self) -> i64
pub fn delta(&self) -> i64
Return the amount of accounts data space that has changed (in bytes)
sourcepub fn consume(&mut self, amount: i64) -> Result<(), InstructionError>
pub fn consume(&mut self, amount: i64) -> Result<(), InstructionError>
Consume accounts data space, in bytes. If amount
is positive, we are increasing the
amount of accounts data space used. If amount
is negative, we are decreasing the
amount of accounts data space used. If amount
is greater than the remaining space,
return an error and do not consume more accounts data space.
sourcepub fn consume_unchecked(&mut self, amount: i64)
pub fn consume_unchecked(&mut self, amount: i64)
Unconditionally consume accounts data space. Refer to consume()
for more documentation.
Trait Implementations
sourceimpl Clone for AccountsDataMeter
impl Clone for AccountsDataMeter
sourcefn clone(&self) -> AccountsDataMeter
fn clone(&self) -> AccountsDataMeter
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for AccountsDataMeter
impl Debug for AccountsDataMeter
sourceimpl Default for AccountsDataMeter
impl Default for AccountsDataMeter
sourcefn default() -> AccountsDataMeter
fn default() -> AccountsDataMeter
Returns the “default value” for a type. Read more
sourceimpl PartialEq<AccountsDataMeter> for AccountsDataMeter
impl PartialEq<AccountsDataMeter> for AccountsDataMeter
sourcefn eq(&self, other: &AccountsDataMeter) -> bool
fn eq(&self, other: &AccountsDataMeter) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &AccountsDataMeter) -> bool
fn ne(&self, other: &AccountsDataMeter) -> bool
This method tests for !=
.
impl Copy for AccountsDataMeter
impl Eq for AccountsDataMeter
impl StructuralEq for AccountsDataMeter
impl StructuralPartialEq for AccountsDataMeter
Auto Trait Implementations
impl RefUnwindSafe for AccountsDataMeter
impl Send for AccountsDataMeter
impl Sync for AccountsDataMeter
impl Unpin for AccountsDataMeter
impl UnwindSafe for AccountsDataMeter
Blanket Implementations
sourceimpl<T> AbiExample for T
impl<T> AbiExample for T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more