pub struct BatchEntry<S: ValueSlot> {
pub key: Vec<u8>,
pub output: S::Output,
/* private fields */
}Expand description
A single entry in a batch insert operation.
Contains the key bytes and the pre-converted output value.
The output is created via S::into_output() before sorting to ensure
allocation happens exactly once per entry.
Fields§
§key: Vec<u8>The key bytes (owned for sorting).
output: S::OutputThe pre-converted output value.
Created via S::into_output(value) to ensure the Arc (if any)
is allocated once and reused across retries.
Implementations§
Source§impl<S: ValueSlot> BatchEntry<S>
impl<S: ValueSlot> BatchEntry<S>
Sourcepub fn new(key: Vec<u8>, value: S::Value) -> Self
pub fn new(key: Vec<u8>, value: S::Value) -> Self
Create a new batch entry from key and value.
Converts the value to output immediately to ensure single allocation.
Sourcepub fn from_output(key: Vec<u8>, output: S::Output) -> Self
pub fn from_output(key: Vec<u8>, output: S::Output) -> Self
Create a batch entry from key and pre-converted output.
Use this when you already have an S::Output (e.g., from a previous
failed batch that needs retry).
Sourcepub const fn has_suffix(&self) -> bool
pub const fn has_suffix(&self) -> bool
Check if this key has a suffix (> 8 bytes).
Auto Trait Implementations§
impl<S> Freeze for BatchEntry<S>
impl<S> RefUnwindSafe for BatchEntry<S>
impl<S> Send for BatchEntry<S>
impl<S> Sync for BatchEntry<S>
impl<S> Unpin for BatchEntry<S>
impl<S> UnwindSafe for BatchEntry<S>
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