pub struct HotStorageReader { /* private fields */ }
Expand description
The reader to a hot accounts file.
Implementations§
source§impl HotStorageReader
impl HotStorageReader
sourcepub fn new_from_path(path: impl AsRef<Path>) -> TieredStorageResult<Self>
pub fn new_from_path(path: impl AsRef<Path>) -> TieredStorageResult<Self>
Constructs a HotStorageReader from the specified path.
Returns the footer of the underlying tiered-storage accounts file.
sourcepub fn num_accounts(&self) -> usize
pub fn num_accounts(&self) -> usize
Returns the number of files inside the underlying tiered-storage accounts file.
sourcepub fn account_matches_owners(
&self,
account_offset: HotAccountOffset,
owners: &[&Pubkey],
) -> Result<usize, MatchAccountOwnerError>
pub fn account_matches_owners( &self, account_offset: HotAccountOffset, owners: &[&Pubkey], ) -> Result<usize, MatchAccountOwnerError>
Returns Ok(index_of_matching_owner) if the account owner at
account_offset
is one of the pubkeys in owners
.
Returns Err(MatchAccountOwnerError::NoMatch) if the account has 0
lamports or the owner is not one of the pubkeys in owners
.
Returns Err(MatchAccountOwnerError::UnableToLoad) if there is any internal
error that causes the data unable to load, including account_offset
causes a data overrun.
sourcepub fn get_account(
&self,
index_offset: IndexOffset,
) -> TieredStorageResult<Option<(StoredAccountMeta<'_>, usize)>>
pub fn get_account( &self, index_offset: IndexOffset, ) -> TieredStorageResult<Option<(StoredAccountMeta<'_>, usize)>>
Returns the account located at the specified index offset.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HotStorageReader
impl RefUnwindSafe for HotStorageReader
impl Send for HotStorageReader
impl Sync for HotStorageReader
impl Unpin for HotStorageReader
impl UnwindSafe for HotStorageReader
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