pub struct PackedBatch {
pub buffer: Bytes,
pub offsets: Vec<usize>,
pub lengths: Vec<usize>,
pub hit_count: usize,
}Expand description
A packed copy-out batch result.
The payload bytes are concatenated into a single contiguous buffer to keep
Python object creation and allocator churn low while we still return owned
data. offsets[index] == usize::MAX marks a miss.
Fields§
§buffer: BytesConcatenated value bytes for all hits.
offsets: Vec<usize>Start offset for each requested item, or usize::MAX for a miss.
lengths: Vec<usize>Value length for each requested item.
hit_count: usizeNumber of requested keys that were present.
Implementations§
Source§impl PackedBatch
impl PackedBatch
Sourcepub fn total_bytes(&self) -> usize
pub fn total_bytes(&self) -> usize
Returns the total number of value bytes copied into buffer.
Sourcepub fn item_count(&self) -> usize
pub fn item_count(&self) -> usize
Returns the number of keys requested in the batch.
Trait Implementations§
Source§impl Clone for PackedBatch
impl Clone for PackedBatch
Source§fn clone(&self) -> PackedBatch
fn clone(&self) -> PackedBatch
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PackedBatch
impl Debug for PackedBatch
Source§impl Default for PackedBatch
impl Default for PackedBatch
Source§fn default() -> PackedBatch
fn default() -> PackedBatch
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PackedBatch
impl RefUnwindSafe for PackedBatch
impl Send for PackedBatch
impl Sync for PackedBatch
impl Unpin for PackedBatch
impl UnsafeUnpin for PackedBatch
impl UnwindSafe for PackedBatch
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