#[repr(u16)]pub enum IndexBlockFormat {
AddressesThenOffsets = 0,
}
Expand description
The index format of a tiered accounts file.
Variants§
AddressesThenOffsets = 0
This format optimizes the storage size by storing only account addresses and block offsets. It skips storing the size of account data by storing account block entries and index block entries in the same order.
Implementations§
source§impl IndexBlockFormat
impl IndexBlockFormat
sourcepub fn write_index_block(
&self,
file: &TieredStorageFile,
index_entries: &[AccountIndexWriterEntry<'_, impl AccountOffset>],
) -> TieredStorageResult<usize>
pub fn write_index_block( &self, file: &TieredStorageFile, index_entries: &[AccountIndexWriterEntry<'_, impl AccountOffset>], ) -> TieredStorageResult<usize>
Persists the specified index_entries to the specified file and returns the total number of bytes written.
sourcepub fn get_account_address<'a>(
&self,
mmap: &'a Mmap,
footer: &TieredStorageFooter,
index_offset: IndexOffset,
) -> TieredStorageResult<&'a Pubkey>
pub fn get_account_address<'a>( &self, mmap: &'a Mmap, footer: &TieredStorageFooter, index_offset: IndexOffset, ) -> TieredStorageResult<&'a Pubkey>
Returns the address of the account given the specified index.
sourcepub fn get_account_offset<Offset: AccountOffset>(
&self,
mmap: &Mmap,
footer: &TieredStorageFooter,
index_offset: IndexOffset,
) -> TieredStorageResult<Offset>
pub fn get_account_offset<Offset: AccountOffset>( &self, mmap: &Mmap, footer: &TieredStorageFooter, index_offset: IndexOffset, ) -> TieredStorageResult<Offset>
Returns the offset to the account given the specified index.
sourcepub fn entry_size<Offset: AccountOffset>(&self) -> usize
pub fn entry_size<Offset: AccountOffset>(&self) -> usize
Returns the size of one index entry.
Trait Implementations§
source§impl Clone for IndexBlockFormat
impl Clone for IndexBlockFormat
source§fn clone(&self) -> IndexBlockFormat
fn clone(&self) -> IndexBlockFormat
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 IndexBlockFormat
impl Debug for IndexBlockFormat
source§impl Default for IndexBlockFormat
impl Default for IndexBlockFormat
source§fn default() -> IndexBlockFormat
fn default() -> IndexBlockFormat
Returns the “default value” for a type. Read more
source§impl From<IndexBlockFormat> for u16
impl From<IndexBlockFormat> for u16
source§fn from(enum_value: IndexBlockFormat) -> Self
fn from(enum_value: IndexBlockFormat) -> Self
Converts to this type from the input type.
source§impl Hash for IndexBlockFormat
impl Hash for IndexBlockFormat
source§impl PartialEq for IndexBlockFormat
impl PartialEq for IndexBlockFormat
source§impl TryFrom<u16> for IndexBlockFormat
impl TryFrom<u16> for IndexBlockFormat
source§type Error = TryFromPrimitiveError<IndexBlockFormat>
type Error = TryFromPrimitiveError<IndexBlockFormat>
The type returned in the event of a conversion error.
source§impl TryFromPrimitive for IndexBlockFormat
impl TryFromPrimitive for IndexBlockFormat
const NAME: &'static str = "IndexBlockFormat"
type Primitive = u16
type Error = TryFromPrimitiveError<IndexBlockFormat>
fn try_from_primitive( number: Self::Primitive, ) -> Result<Self, TryFromPrimitiveError<Self>>
impl Copy for IndexBlockFormat
impl Eq for IndexBlockFormat
impl StructuralPartialEq for IndexBlockFormat
Auto Trait Implementations§
impl Freeze for IndexBlockFormat
impl RefUnwindSafe for IndexBlockFormat
impl Send for IndexBlockFormat
impl Sync for IndexBlockFormat
impl Unpin for IndexBlockFormat
impl UnwindSafe for IndexBlockFormat
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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§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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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