pub struct AccountStorageEntry {
pub accounts: AccountsFile,
/* private fields */
}Expand description
Persistent storage structure holding the accounts
Fields§
§accounts: AccountsFilestorage holding the accounts
Implementations§
Source§impl AccountStorageEntry
impl AccountStorageEntry
pub fn new( path: &Path, slot: Slot, id: AccountsFileId, file_size: u64, provider: AccountsFileProvider, ) -> Self
pub fn new_existing( slot: Slot, id: AccountsFileId, accounts: AccountsFile, ) -> Self
pub fn set_status(&self, status: AccountStorageStatus)
pub fn status(&self) -> AccountStorageStatus
pub fn count(&self) -> usize
pub fn alive_bytes(&self) -> usize
Sourcepub fn mark_accounts_obsolete(
&self,
newly_obsolete_accounts: impl ExactSizeIterator<Item = (Offset, usize)>,
slot: Slot,
)
pub fn mark_accounts_obsolete( &self, newly_obsolete_accounts: impl ExactSizeIterator<Item = (Offset, usize)>, slot: Slot, )
Marks the accounts at the given offsets as obsolete
Sourcepub fn get_obsolete_accounts(&self, slot: Option<Slot>) -> Vec<(Offset, usize)>
pub fn get_obsolete_accounts(&self, slot: Option<Slot>) -> Vec<(Offset, usize)>
Returns the accounts that were marked obsolete as of the passed in slot or earlier. If slot is None, then slot will be assumed to be the max root and all obsolete accounts will be returned.
Sourcepub fn get_obsolete_bytes(&self, slot: Option<Slot>) -> usize
pub fn get_obsolete_bytes(&self, slot: Option<Slot>) -> usize
Returns the number of bytes that were marked obsolete as of the passed in slot or earlier. If slot is None, then slot will be assumed to be the max root, and all obsolete bytes will be returned.
pub fn written_bytes(&self) -> u64
pub fn capacity(&self) -> u64
pub fn has_accounts(&self) -> bool
pub fn slot(&self) -> Slot
pub fn id(&self) -> AccountsFileId
pub fn flush(&self) -> Result<(), AccountsFileError>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AccountStorageEntry
impl !RefUnwindSafe for AccountStorageEntry
impl Send for AccountStorageEntry
impl Sync for AccountStorageEntry
impl Unpin for AccountStorageEntry
impl UnwindSafe for AccountStorageEntry
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> 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