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 duplicate 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 for AccountsDataMeter
impl PartialEq for AccountsDataMeter
impl Copy for AccountsDataMeter
impl Eq for AccountsDataMeter
impl StructuralPartialEq for AccountsDataMeter
Auto Trait Implementations§
impl Freeze for AccountsDataMeter
impl RefUnwindSafe for AccountsDataMeter
impl Send for AccountsDataMeter
impl Sync for AccountsDataMeter
impl Unpin for AccountsDataMeter
impl UnwindSafe for AccountsDataMeter
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more