Skip to main content

LazyVecFrom1

Struct LazyVecFrom1 

Source
pub struct LazyVecFrom1<I, T, S1I, S1T>
where S1T: Clone,
{ /* private fields */ }
Expand description

Lazily computed vector deriving values on-the-fly from one source vector.

Unlike EagerVec, no data is stored on disk. Values are computed during iteration by applying a function to the source vector’s elements. Use when:

  • Storage space is limited
  • Computation is cheap relative to disk I/O
  • Values are only accessed once or infrequently

For frequently accessed derived data, prefer EagerVec for better performance.

Implementations§

Source§

impl<I, T, S1I, S1T> LazyVecFrom1<I, T, S1I, S1T>
where I: VecIndex, T: VecValue, S1I: VecIndex, S1T: VecValue,

Source

pub fn init( name: &str, version: Version, source: IterableBoxedVec<S1I, S1T>, compute: ComputeFrom1<I, T, S1I, S1T>, ) -> Self

Source

pub fn read_once(&self, index: I) -> Result<T>

Read a single value at the given index. Creates an iterator internally, so prefer into_iter() for multiple reads.

Source§

impl<I, T, S1T> LazyVecFrom1<I, T, I, S1T>
where I: VecIndex, T: VecValue, S1T: VecValue,

Source

pub fn transformed<F: UnaryTransform<S1T, T>>( name: &str, version: Version, source: IterableBoxedVec<I, S1T>, ) -> Self

Create a lazy vec with a generic transform. Usage: LazyVecFrom1::transformed::<Negate>(name, v, source)

Trait Implementations§

Source§

impl<I, T, S1I, S1T> AnyVec for LazyVecFrom1<I, T, S1I, S1T>
where I: VecIndex, T: VecValue, S1I: VecIndex, S1T: VecValue,

Source§

fn version(&self) -> Version

Source§

fn name(&self) -> &str

Source§

fn index_type_to_string(&self) -> &'static str

Returns the string representation of the index type.
Source§

fn len(&self) -> usize

Source§

fn value_type_to_size_of(&self) -> usize

Returns the size in bytes of the value type.
Source§

fn value_type_to_string(&self) -> &'static str

Returns the short type name of the value type (e.g., “Sats”, “StoredF64”).
Source§

fn region_names(&self) -> Vec<String>

Returns the list of region names used by this vector.
Source§

fn is_empty(&self) -> bool

Source§

fn region_name(&self) -> String

Returns the combined name of the vector.
Source§

fn etag(&self, stamp: Stamp, to: Option<i64>) -> String

Generates an ETag for this vector based on stamp and optional end index.
Source§

fn i64_to_usize(&self, i: i64) -> usize

Converts an i64 index to usize, supporting negative indexing (Python-style).
Source§

impl<I: Clone, T: Clone, S1I: Clone, S1T> Clone for LazyVecFrom1<I, T, S1I, S1T>
where S1T: Clone + Clone,

Source§

fn clone(&self) -> LazyVecFrom1<I, T, S1I, S1T>

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, I, T, S1I, S1T> IntoIterator for &'a LazyVecFrom1<I, T, S1I, S1T>
where I: VecIndex, T: VecValue + 'a, S1I: VecIndex, S1T: VecValue,

Source§

type Item = T

The type of the elements being iterated over.
Source§

type IntoIter = LazyVecFrom1Iterator<'a, I, T, S1I, S1T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<I, T, S1I, S1T> IterableVec<I, T> for LazyVecFrom1<I, T, S1I, S1T>
where I: VecIndex, T: VecValue, S1I: VecIndex, S1T: VecValue,

Source§

fn iter(&self) -> BoxedVecIterator<'_, I, T>

Source§

fn create_lookback( &self, skip: usize, window: usize, min_start: usize, ) -> Lookback<'_, I, T>
where I: VecIndex, T: VecValue,

Create a windowed lookback for efficient windowed access. Uses a ring buffer if many items will be processed, otherwise uses direct access.
Source§

impl<I, T, S1I, S1T> TypedVec for LazyVecFrom1<I, T, S1I, S1T>
where I: VecIndex, T: VecValue, S1I: VecIndex, S1T: VecValue,

Source§

type I = I

The index type used to address elements in this vector.
Source§

type T = T

The value type stored in this vector.

Auto Trait Implementations§

§

impl<I, T, S1I, S1T> Freeze for LazyVecFrom1<I, T, S1I, S1T>

§

impl<I, T, S1I, S1T> !RefUnwindSafe for LazyVecFrom1<I, T, S1I, S1T>

§

impl<I, T, S1I, S1T> Send for LazyVecFrom1<I, T, S1I, S1T>

§

impl<I, T, S1I, S1T> Sync for LazyVecFrom1<I, T, S1I, S1T>

§

impl<I, T, S1I, S1T> Unpin for LazyVecFrom1<I, T, S1I, S1T>

§

impl<I, T, S1I, S1T> !UnwindSafe for LazyVecFrom1<I, T, S1I, S1T>

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<V> AnyCollectableVec for V
where V: TypedVec + CollectableVec<<V as TypedVec>::I, <V as TypedVec>::T>,

Source§

fn range_count(&self, from: Option<i64>, to: Option<i64>) -> usize

Returns the number of items in the specified range.
Source§

fn range_weight(&self, from: Option<i64>, to: Option<i64>) -> usize

Returns the total size in bytes of items in the specified range.
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<I, T, V> CollectableVec<I, T> for V
where V: IterableVec<I, T> + Clone, I: VecIndex, T: VecValue,

Source§

fn iter_range( &self, from: Option<usize>, to: Option<usize>, ) -> impl Iterator<Item = T>

Returns an iterator over the specified range.
Source§

fn iter_signed_range( &self, from: Option<i64>, to: Option<i64>, ) -> impl Iterator<Item = T>

Returns an iterator over the specified range using signed indices (supports negative indexing).
Source§

fn collect(&self) -> Vec<T>

Collects all values into a Vec.
Source§

fn collect_range(&self, from: Option<usize>, to: Option<usize>) -> Vec<T>

Collects values in the specified range into a Vec.
Source§

fn collect_signed_range(&self, from: Option<i64>, to: Option<i64>) -> Vec<T>

Collects values in the specified range into a Vec using signed indices.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<I, T, U> IterableCloneableVec<I, T> for U
where U: 'static + IterableVec<I, T> + Clone,

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
Source§

impl<V> AnyExportableVec for V