PartitionedRead

Struct PartitionedRead 

Source
pub struct PartitionedRead<'a, V> { /* private fields */ }
Expand description

Read operations for partitioned tables.

Provides read-only access to partitioned data without the ability to modify.

Implementations§

Source§

impl<'a, V> PartitionedRead<'a, V>

Source

pub fn new(table: &'a PartitionedTable<V>, txn: &'a ReadTransaction) -> Self

Creates a new read handle.

Source

pub fn table(&self) -> &PartitionedTable<V>

Gets the table reference.

Source

pub fn collect_all_segments( &self, key: &[u8], ) -> Result<HashMap<u16, Vec<(SegmentInfo, Option<Vec<u8>>)>>>

Collects all segments across all shards for a given base key.

This method iterates through all shards and collects all segments that belong to the specified base key.

§Arguments
  • key - The key to search for
§Returns

HashMap where key is shard ID and value is vector of (segment_info, segment_data) tuples

Source

pub fn enumerate_all_segments( &self, key: &[u8], ) -> Result<HashMap<u16, Vec<(u16, Vec<u8>)>>>

Enumerates all segments for a given base key across all shards.

This method returns segment data in a simplified format for easier consumption by callers.

§Arguments
  • key - The key to search for
§Returns

HashMap where key is shard ID and value is vector of (segment_id, segment_data) tuples

Source

pub fn read_segment_data( &self, segment_info: &SegmentInfo, ) -> Result<Option<(SegmentInfo, Vec<u8>)>>

Reads data for a specific segment.

If segment_info already contains data, it’s returned directly. Otherwise, the data is read from the database.

§Arguments
  • segment_info - Information about the segment to read
§Returns

Option containing (segment_info, segment_data) or None if segment doesn’t exist

Auto Trait Implementations§

§

impl<'a, V> Freeze for PartitionedRead<'a, V>

§

impl<'a, V> !RefUnwindSafe for PartitionedRead<'a, V>

§

impl<'a, V> Send for PartitionedRead<'a, V>
where V: Sync,

§

impl<'a, V> Sync for PartitionedRead<'a, V>
where V: Sync,

§

impl<'a, V> Unpin for PartitionedRead<'a, V>

§

impl<'a, V> !UnwindSafe for PartitionedRead<'a, V>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.