BatchEntry

Struct BatchEntry 

Source
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::Output

The 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>

Source

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.

Source

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).

Source

pub const fn ikey(&self) -> u64

Get the cached ikey.

Source

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>
where <S as ValueSlot>::Output: Freeze,

§

impl<S> RefUnwindSafe for BatchEntry<S>

§

impl<S> Send for BatchEntry<S>
where <S as ValueSlot>::Output: Send,

§

impl<S> Sync for BatchEntry<S>
where <S as ValueSlot>::Output: Sync,

§

impl<S> Unpin for BatchEntry<S>
where <S as ValueSlot>::Output: Unpin,

§

impl<S> UnwindSafe for BatchEntry<S>
where <S as ValueSlot>::Output: UnwindSafe,

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.