Skip to main content

DecodedStore

Struct DecodedStore 

Source
pub struct DecodedStore<'a> { /* private fields */ }
Expand description

A zero-allocation view into indexed-encoded data, providing random access to individual slices.

Constructed from &[u64] in O(1), this wraps the offset index and data region and provides get(k) to retrieve the k-th slice as (&[u64], u8). Each access is independent — no iterator state — enabling LLVM to eliminate unused field lookups entirely.

Implementations§

Source§

impl<'a> DecodedStore<'a>

Source

pub fn new(store: &'a [u64]) -> Self

Creates a decoded view of an indexed-encoded &[u64] store.

This is O(1) — it just reads the first offset to locate the index and data regions. No allocation, no iteration.

Source

pub fn get(&self, k: usize) -> (&'a [u64], u8)

Returns the k-th slice as (&[u64], u8).

The u8 is the number of valid trailing bytes in the last word (0 means all 8 are valid). Returns an empty slice for out-of-bounds access.

Source

pub fn len(&self) -> usize

The number of slices in the store.

Trait Implementations§

Source§

impl<'a> Clone for DecodedStore<'a>

Source§

fn clone(&self) -> DecodedStore<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for DecodedStore<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for DecodedStore<'a>

§

impl<'a> RefUnwindSafe for DecodedStore<'a>

§

impl<'a> Send for DecodedStore<'a>

§

impl<'a> Sync for DecodedStore<'a>

§

impl<'a> Unpin for DecodedStore<'a>

§

impl<'a> UnwindSafe for DecodedStore<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> CopyAs<T> for T
where T: Copy,

Source§

fn copy_as(self) -> T

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.