pub struct ChunkIndex { /* private fields */ }Expand description
Index of all chunks in a streaming dataset
Implementations§
Source§impl ChunkIndex
impl ChunkIndex
Sourcepub fn from_entries(entries: Vec<ChunkEntry>) -> Self
pub fn from_entries(entries: Vec<ChunkEntry>) -> Self
Create chunk index from entries
Sourcepub fn push(&mut self, entry: ChunkEntry)
pub fn push(&mut self, entry: ChunkEntry)
Add a chunk entry
Sourcepub fn total_rows(&self) -> u64
pub fn total_rows(&self) -> u64
Get total row count
Sourcepub fn get(&self, index: usize) -> Option<&ChunkEntry>
pub fn get(&self, index: usize) -> Option<&ChunkEntry>
Get chunk entry by index
Sourcepub fn find_chunk_for_row(&self, row: u64) -> Option<usize>
pub fn find_chunk_for_row(&self, row: u64) -> Option<usize>
Find chunk containing the given row
Sourcepub fn iter(&self) -> impl Iterator<Item = &ChunkEntry>
pub fn iter(&self) -> impl Iterator<Item = &ChunkEntry>
Iterate over entries
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
Deserialize from bytes
Trait Implementations§
Source§impl Clone for ChunkIndex
impl Clone for ChunkIndex
Source§fn clone(&self) -> ChunkIndex
fn clone(&self) -> ChunkIndex
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 ChunkIndex
impl Debug for ChunkIndex
Source§impl Default for ChunkIndex
impl Default for ChunkIndex
Source§fn default() -> ChunkIndex
fn default() -> ChunkIndex
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ChunkIndex
impl<'de> Deserialize<'de> for ChunkIndex
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ChunkIndex
impl RefUnwindSafe for ChunkIndex
impl Send for ChunkIndex
impl Sync for ChunkIndex
impl Unpin for ChunkIndex
impl UnsafeUnpin for ChunkIndex
impl UnwindSafe for ChunkIndex
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<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 moreCreates a shared type from an unshared type.