pub struct AccountsDataMeter { /* private fields */ }
Expand description
Meter and track the amount of available accounts data space
Implementations§
source§impl 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 adjust_delta(&mut self, amount: i64) -> Result<(), InstructionError>
pub fn adjust_delta(&mut self, amount: i64) -> Result<(), InstructionError>
Adjust the space used by accounts data by amount
(in bytes).
If amount
is positive, we increase the space used by accounts data. If amount
is
negative, we decrease the space used by accounts data. If amount
is greater than
the remaining space, return an error and do not adjust accounts data space.
sourcepub fn adjust_delta_unchecked(&mut self, amount: i64)
pub fn adjust_delta_unchecked(&mut self, amount: i64)
Unconditionally adjust accounts data space. Refer to adjust_delta()
for more
documentation.
Trait Implementations§
source§impl Clone for AccountsDataMeter
impl Clone for AccountsDataMeter
source§fn clone(&self) -> AccountsDataMeter
fn clone(&self) -> AccountsDataMeter
Returns a copy of the value. Read more
1.0.0 · 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 AccountsDataMeter
impl Debug for AccountsDataMeter
source§impl Default for AccountsDataMeter
impl Default for AccountsDataMeter
source§fn default() -> AccountsDataMeter
fn default() -> AccountsDataMeter
Returns the “default value” for a type. Read more
source§impl PartialEq<AccountsDataMeter> for AccountsDataMeter
impl PartialEq<AccountsDataMeter> for AccountsDataMeter
source§fn 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 ==
.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§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.