pub struct SlotIndex {
pub starting_slot: u64,
pub offsets: Vec<i64>,
}
Expand description
SlotIndex
records store offsets to data at specific slots
from the beginning of the index record to the beginning of the corresponding data.
Format: starting-slot | index | index | index ... | count
See also https://github.com/status-im/nimbus-eth2/blob/stable/docs/e2store.md#slotindex.
Fields§
§starting_slot: u64
Starting slot number
offsets: Vec<i64>
Offsets to data at each slot 0 indicates no data for that slot
Implementations§
Source§impl SlotIndex
impl SlotIndex
Sourcepub const fn slot_count(&self) -> usize
pub const fn slot_count(&self) -> usize
Get the number of slots covered by this index
Sourcepub fn get_offset(&self, slot_index: usize) -> Option<i64>
pub fn get_offset(&self, slot_index: usize) -> Option<i64>
Get the offset for a specific slot
Sourcepub fn has_data_at_slot(&self, slot_index: usize) -> bool
pub fn has_data_at_slot(&self, slot_index: usize) -> bool
Check if a slot has data - non-zero offset
Trait Implementations§
Source§impl IndexEntry for SlotIndex
impl IndexEntry for SlotIndex
Source§fn new(starting_number: u64, offsets: Vec<i64>) -> Self
fn new(starting_number: u64, offsets: Vec<i64>) -> Self
Source§fn entry_type() -> [u8; 2]
fn entry_type() -> [u8; 2]
Source§fn starting_number(&self) -> u64
fn starting_number(&self) -> u64
impl Eq for SlotIndex
impl StructuralPartialEq for SlotIndex
Auto Trait Implementations§
impl Freeze for SlotIndex
impl RefUnwindSafe for SlotIndex
impl Send for SlotIndex
impl Sync for SlotIndex
impl Unpin for SlotIndex
impl UnwindSafe for SlotIndex
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes