pub struct ReftableReader { /* private fields */ }Expand description
Reads a single reftable file from a byte buffer.
Implementations§
Source§impl ReftableReader
impl ReftableReader
Sourcepub fn from_arc(data: Arc<[u8]>) -> Result<Self>
pub fn from_arc(data: Arc<[u8]>) -> Result<Self>
Open a reftable from shared bytes (avoids cloning table payloads).
Sourcepub fn for_each_ref(
&self,
f: impl FnMut(&RefRecord) -> ControlFlow<()>,
) -> Result<()>
pub fn for_each_ref( &self, f: impl FnMut(&RefRecord) -> ControlFlow<()>, ) -> Result<()>
Visit ref records in sorted name order, optionally bounded by lower (inclusive)
and upper_exclusive (exclusive). When upper_exclusive is None, iteration
continues through the last ref block.
Sourcepub fn for_each_ref_in_range(
&self,
lower: &str,
upper_exclusive: Option<&str>,
f: impl FnMut(&RefRecord) -> ControlFlow<()>,
) -> Result<()>
pub fn for_each_ref_in_range( &self, lower: &str, upper_exclusive: Option<&str>, f: impl FnMut(&RefRecord) -> ControlFlow<()>, ) -> Result<()>
Visit ref records with name >= lower and < upper_exclusive when set.
Sourcepub fn lookup_ref(&self, name: &str) -> Result<Option<RefRecord>>
pub fn lookup_ref(&self, name: &str) -> Result<Option<RefRecord>>
Look up a single ref by name.
Sourcepub fn block_size(&self) -> u32
pub fn block_size(&self) -> u32
Get the block size from the header.
Sourcepub fn min_update_index(&self) -> u64
pub fn min_update_index(&self) -> u64
Get the min update index.
Sourcepub fn max_update_index(&self) -> u64
pub fn max_update_index(&self) -> u64
Get the max update index.
Sourcepub fn ref_index_offset(&self) -> u64
pub fn ref_index_offset(&self) -> u64
Byte offset of the top-level ref index section, or 0 if none.
Sourcepub fn payload_size(&self) -> u64
pub fn payload_size(&self) -> u64
Effective ref payload size for compaction heuristics (file size minus header overhead).
Auto Trait Implementations§
impl Freeze for ReftableReader
impl RefUnwindSafe for ReftableReader
impl Send for ReftableReader
impl Sync for ReftableReader
impl Unpin for ReftableReader
impl UnsafeUnpin for ReftableReader
impl UnwindSafe for ReftableReader
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