Struct EagerVec

Source
pub struct EagerVec<I, T>(/* private fields */);

Implementations§

Source§

impl<I, T> EagerVec<I, T>

Source

pub fn forced_import_compressed( db: &Database, name: &str, version: Version, ) -> Result<Self>

Source

pub fn forced_import_compressed_with(options: ImportOptions<'_>) -> Result<Self>

Source

pub fn forced_import_raw( db: &Database, name: &str, version: Version, ) -> Result<Self>

Source

pub fn forced_import_raw_with(options: ImportOptions<'_>) -> Result<Self>

Source

pub fn forced_import( db: &Database, name: &str, version: Version, format: Format, ) -> Result<Self>

Source

pub fn forced_import_with( options: ImportOptions<'_>, format: Format, ) -> Result<Self>

Source

pub fn get_or_read<'a, 'b>( &'a self, index: I, reader: &'b Reader<'_>, ) -> Result<Option<Cow<'b, T>>>
where 'a: 'b,

Source

pub fn inner_version(&self) -> Version

Source

pub fn validate_computed_version_or_reset( &mut self, version: Version, ) -> Result<()>

Source

pub fn compute_to<F>( &mut self, max_from: I, to: usize, version: Version, t: F, exit: &Exit, ) -> Result<()>
where F: FnMut(I) -> (I, T),

Source

pub fn compute_range<A, F>( &mut self, max_from: I, other: &impl AnyIterableVec<I, A>, t: F, exit: &Exit, ) -> Result<()>
where A: StoredRaw, F: FnMut(I) -> (I, T),

Source

pub fn compute_from_index<T2>( &mut self, max_from: I, other: &impl AnyIterableVec<I, T2>, exit: &Exit, ) -> Result<()>
where T: From<I>, T2: StoredRaw,

Source

pub fn compute_transform<A, B, F>( &mut self, max_from: A, other: &impl AnyIterableVec<A, B>, t: F, exit: &Exit, ) -> Result<()>
where A: StoredIndex, B: StoredRaw, F: FnMut((A, B, &Self)) -> (I, T),

Source

pub fn compute_transform2<A, B, C, F>( &mut self, max_from: A, other1: &impl AnyIterableVec<A, B>, other2: &impl AnyIterableVec<A, C>, t: F, exit: &Exit, ) -> Result<()>
where A: StoredIndex, B: StoredRaw, C: StoredRaw, F: FnMut((A, B, C, &Self)) -> (I, T),

Source

pub fn compute_add( &mut self, max_from: I, added: &impl AnyIterableVec<I, T>, adder: &impl AnyIterableVec<I, T>, exit: &Exit, ) -> Result<()>
where T: Add<Output = T>,

Source

pub fn compute_subtract( &mut self, max_from: I, subtracted: &impl AnyIterableVec<I, T>, subtracter: &impl AnyIterableVec<I, T>, exit: &Exit, ) -> Result<()>
where T: CheckedSub,

Source

pub fn compute_max<T2>( &mut self, max_from: I, source: &impl AnyIterableVec<I, T2>, exit: &Exit, ) -> Result<()>
where T: From<T2> + Ord, T2: StoredRaw,

Source

pub fn compute_multiply<T2, T3, T4>( &mut self, max_from: I, multiplied: &impl AnyIterableVec<I, T2>, multiplier: &impl AnyIterableVec<I, T3>, exit: &Exit, ) -> Result<()>
where T2: StoredRaw + Mul<T3, Output = T4>, T3: StoredRaw, T4: StoredRaw, T: From<T4>,

Source

pub fn compute_divide<T2, T3, T4, T5>( &mut self, max_from: I, divided: &impl AnyIterableVec<I, T2>, divider: &impl AnyIterableVec<I, T3>, exit: &Exit, ) -> Result<()>
where T2: StoredRaw + Mul<usize, Output = T4>, T3: StoredRaw, T4: Div<T3, Output = T5> + From<T2>, T5: CheckedSub<usize>, T: From<T5>,

Source

pub fn compute_percentage<T2, T3, T4, T5>( &mut self, max_from: I, divided: &impl AnyIterableVec<I, T2>, divider: &impl AnyIterableVec<I, T3>, exit: &Exit, ) -> Result<()>
where T2: StoredRaw + Mul<usize, Output = T4>, T3: StoredRaw, T4: Div<T3, Output = T5> + From<T2>, T5: CheckedSub<usize>, T: From<T5>,

Source

pub fn compute_percentage_difference<T2, T3, T4, T5>( &mut self, max_from: I, divided: &impl AnyIterableVec<I, T2>, divider: &impl AnyIterableVec<I, T3>, exit: &Exit, ) -> Result<()>
where T2: StoredRaw + Mul<usize, Output = T4>, T3: StoredRaw, T4: Div<T3, Output = T5> + From<T2>, T5: CheckedSub<usize>, T: From<T5>,

Source

pub fn compute_divide_<T2, T3, T4, T5>( &mut self, max_from: I, divided: &impl AnyIterableVec<I, T2>, divider: &impl AnyIterableVec<I, T3>, exit: &Exit, as_percentage: bool, as_difference: bool, ) -> Result<()>
where T2: StoredRaw + Mul<usize, Output = T4>, T3: StoredRaw, T4: Div<T3, Output = T5> + From<T2>, T5: CheckedSub<usize>, T: From<T5>,

Source

pub fn compute_inverse_more_to_less( &mut self, max_from: T, other: &impl AnyIterableVec<T, I>, exit: &Exit, ) -> Result<()>

Source

pub fn compute_inverse_less_to_more<T2>( &mut self, max_from: T, first_indexes: &impl AnyIterableVec<T, I>, indexes_count: &impl AnyIterableVec<T, T2>, exit: &Exit, ) -> Result<()>
where I: StoredRaw, T: StoredIndex, T2: StoredRaw, usize: From<T2>,

Source

pub fn compute_count_from_indexes<T2, T3>( &mut self, max_from: I, first_indexes: &impl AnyIterableVec<I, T2>, other_to_else: &impl AnyIterableVec<T2, T3>, exit: &Exit, ) -> Result<()>
where T: From<T2>, T2: StoredRaw + StoredIndex + Copy + Add<usize, Output = T2> + CheckedSub<T2> + TryInto<T> + Default, <T2 as TryInto<T>>::Error: Error + 'static, T3: StoredRaw,

Source

pub fn compute_filtered_count_from_indexes<T2, T3, F>( &mut self, max_from: I, first_indexes: &impl AnyIterableVec<I, T2>, other_to_else: &impl AnyIterableVec<T2, T3>, filter: F, exit: &Exit, ) -> Result<()>
where T: From<T2>, T2: StoredRaw + StoredIndex + Copy + Add<usize, Output = T2> + CheckedSub<T2> + TryInto<T> + Default, <T2 as TryInto<T>>::Error: Error + 'static, T3: StoredRaw, F: FnMut(T2) -> bool,

Source

pub fn compute_is_first_ordered<A>( &mut self, max_from: I, self_to_other: &impl AnyIterableVec<I, A>, other_to_self: &impl AnyIterableVec<A, I>, exit: &Exit, ) -> Result<()>
where I: StoredRaw, T: From<bool>, A: StoredIndex + StoredRaw,

Source

pub fn compute_sum_from_indexes<T2, T3>( &mut self, max_from: I, first_indexes: &impl AnyIterableVec<I, T2>, indexes_count: &impl AnyIterableVec<I, T3>, source: &impl AnyIterableVec<T2, T>, exit: &Exit, ) -> Result<()>
where T: From<usize> + Add<T, Output = T>, T2: StoredIndex + StoredRaw, T3: StoredRaw, usize: From<T3>,

Source

pub fn compute_sum_of_others( &mut self, max_from: I, others: &[&impl AnyIterableVec<I, T>], exit: &Exit, ) -> Result<()>
where T: From<usize> + Add<T, Output = T>,

Source

pub fn compute_min_of_others( &mut self, max_from: I, others: &[&impl AnyIterableVec<I, T>], exit: &Exit, ) -> Result<()>
where T: From<usize> + Add<T, Output = T> + Ord,

Source

pub fn compute_max_of_others( &mut self, max_from: I, others: &[&impl AnyIterableVec<I, T>], exit: &Exit, ) -> Result<()>
where T: From<usize> + Add<T, Output = T> + Ord,

Source

pub fn compute_sma<T2>( &mut self, max_from: I, source: &impl AnyIterableVec<I, T2>, sma: usize, exit: &Exit, ) -> Result<()>
where T: Add<T, Output = T> + From<T2> + Div<usize, Output = T> + From<f32>, T2: StoredRaw, f32: From<T> + From<T2>,

Source

pub fn compute_sma_<T2>( &mut self, max_from: I, source: &impl AnyIterableVec<I, T2>, sma: usize, exit: &Exit, min_i: Option<I>, ) -> Result<()>
where T: Add<T, Output = T> + From<T2> + Div<usize, Output = T> + From<f32>, T2: StoredRaw, f32: From<T> + From<T2>,

Source

pub fn compute_previous_value<T2>( &mut self, max_from: I, source: &impl AnyIterableVec<I, T2>, len: usize, exit: &Exit, ) -> Result<()>
where I: CheckedSub, T2: StoredRaw + Default, f32: From<T2>, T: From<f32>,

Source

pub fn compute_change( &mut self, max_from: I, source: &impl AnyIterableVec<I, T>, len: usize, exit: &Exit, ) -> Result<()>
where I: CheckedSub, T: CheckedSub + Default,

Source

pub fn compute_percentage_change<T2>( &mut self, max_from: I, source: &impl AnyIterableVec<I, T2>, len: usize, exit: &Exit, ) -> Result<()>
where I: CheckedSub, T2: StoredRaw + Default, f32: From<T2>, T: From<f32>,

Source

pub fn compute_cagr<T2>( &mut self, max_from: I, percentage_returns: &impl AnyIterableVec<I, T2>, days: usize, exit: &Exit, ) -> Result<()>
where I: CheckedSub, T2: StoredRaw + Default, f32: From<T2>, T: From<f32>,

Source

pub fn compute_zscore<T2, T3, T4>( &mut self, max_from: I, ratio: &impl AnyIterableVec<I, T2>, sma: &impl AnyIterableVec<I, T3>, sd: &impl AnyIterableVec<I, T4>, exit: &Exit, ) -> Result<()>
where T: From<f32>, T2: StoredRaw + Sub<T3, Output = T2> + Div<T4, Output = T>, T3: StoredRaw, T4: StoredRaw, f32: From<T2> + From<T3> + From<T4>,

Trait Implementations§

Source§

impl<I, T> AnyCollectableVec for EagerVec<I, T>

Source§

fn collect_range_serde_json( &self, from: Option<usize>, to: Option<usize>, ) -> Result<Vec<Value>>

Source§

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

Source§

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

Source§

impl<I, T> AnyIterableVec<I, T> for EagerVec<I, T>

Source§

fn boxed_iter<'a>(&'a self) -> BoxedVecIterator<'a, I, T>
where I: StoredIndex, T: StoredRaw + 'a,

Source§

fn iter<'a>(&'a self) -> BoxedVecIterator<'a, I, T>
where I: StoredIndex, T: StoredRaw + 'a,

Source§

fn iter_at<'a>(&'a self, i: I) -> BoxedVecIterator<'a, I, T>
where I: StoredIndex, T: StoredRaw + 'a,

Source§

fn iter_at_<'a>(&'a self, i: usize) -> BoxedVecIterator<'a, I, T>
where I: StoredIndex, T: StoredRaw + 'a,

Source§

impl<I, T> AnyStoredVec for EagerVec<I, T>

Source§

fn db(&self) -> &Database

Source§

fn region_index(&self) -> usize

Source§

fn region(&self) -> &RwLock<Region>

Source§

fn header(&self) -> &Header

Source§

fn mut_header(&mut self) -> &mut Header

Source§

fn saved_stamped_changes(&self) -> u16

Source§

fn flush(&mut self) -> Result<()>

Source§

fn stored_len(&self) -> usize

Source§

fn real_stored_len(&self) -> usize

Source§

fn serialize_changes(&self) -> Result<Vec<u8>>

Source§

fn safe_flush(&mut self, exit: &Exit) -> Result<()>

Source§

fn update_stamp(&mut self, stamp: Stamp)

Source§

fn stamp(&self) -> Stamp

Source§

fn changes_path(&self) -> PathBuf

Source§

fn stamped_flush(&mut self, stamp: Stamp) -> Result<()>

Source§

impl<I, T> AnyVec for EagerVec<I, T>

Source§

fn version(&self) -> Version

Source§

fn name(&self) -> &str

Source§

fn len(&self) -> usize

Source§

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

Source§

fn value_type_to_size_of(&self) -> usize

Source§

fn is_empty(&self) -> bool

Source§

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

Source§

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

Source§

impl<I: Clone, T: Clone> Clone for EagerVec<I, T>

Source§

fn clone(&self) -> EagerVec<I, T>

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<I: Debug, T: Debug> Debug for EagerVec<I, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<I, T> GenericStoredVec<I, T> for EagerVec<I, T>

Source§

fn read_(&self, index: usize, reader: &Reader<'_>) -> Result<T>

Source§

fn pushed(&self) -> &[T]

Source§

fn mut_pushed(&mut self) -> &mut Vec<T>

Source§

fn holes(&self) -> &BTreeSet<usize>

Source§

fn mut_holes(&mut self) -> &mut BTreeSet<usize>

Source§

fn updated(&self) -> &BTreeMap<usize, T>

Source§

fn mut_updated(&mut self) -> &mut BTreeMap<usize, T>

Source§

fn truncate_if_needed(&mut self, index: I) -> Result<()>

Source§

fn reset(&mut self) -> Result<()>

Source§

const SIZE_OF_T: usize = _

Source§

fn create_reader(&self) -> Reader<'_>

Be careful with deadlocks Read more
Source§

fn create_static_reader(&self) -> Reader<'static>

Be careful with deadlocks Read more
Source§

fn unwrap_read(&self, index: I, reader: &Reader<'_>) -> T

Source§

fn unwrap_read_(&self, index: usize, reader: &Reader<'_>) -> T

Source§

fn read(&self, index: I, reader: &Reader<'_>) -> Result<T>

Source§

fn get_or_read( &self, index: I, reader: &Reader<'_>, ) -> Result<Option<Cow<'_, T>>>

Source§

fn get_or_read_( &self, index: usize, reader: &Reader<'_>, ) -> Result<Option<Cow<'_, T>>>

Source§

fn len_(&self) -> usize

Source§

fn pushed_len(&self) -> usize

Source§

fn push(&mut self, value: T)

Source§

fn push_if_needed(&mut self, index: I, value: T) -> Result<()>

Source§

fn forced_push_at(&mut self, index: I, value: T, exit: &Exit) -> Result<()>

Source§

fn update_or_push(&mut self, index: I, value: T) -> Result<()>

Source§

fn get_first_empty_index(&self) -> I

Source§

fn fill_first_hole_or_push(&mut self, value: T) -> Result<I>

Source§

fn take(&mut self, index: I, reader: &Reader<'_>) -> Result<Option<T>>

Source§

fn delete(&mut self, index: I)

Source§

fn update(&mut self, index: I, value: T) -> Result<()>

Source§

fn update_(&mut self, index: usize, value: T) -> Result<()>

Source§

fn reset_(&mut self) -> Result<()>

Source§

fn is_pushed_empty(&self) -> bool

Source§

fn has(&self, index: I) -> Result<bool>

Source§

fn has_(&self, index: usize) -> bool

Source§

fn truncate_if_needed_(&mut self, index: usize) -> Result<()>

Source§

fn truncate_if_needed_with_stamp( &mut self, index: I, stamp: Stamp, ) -> Result<()>

Source§

fn deserialize_then_undo_changes(&mut self, bytes: &[u8]) -> Result<()>

Source§

fn rollback_stamp(&mut self, stamp: Stamp) -> Result<()>

Source§

fn collect_holed(&self) -> Result<Vec<Option<T>>>

Source§

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

Source§

fn index_to_name(&self) -> String

Source§

fn vec_region_name(&self) -> String

Source§

fn vec_region_name_(name: &str) -> String

Source§

fn holes_region_name(&self) -> String

Source§

fn holes_region_name_(name: &str) -> String

Source§

impl<'a, I, T> IntoIterator for &'a EagerVec<I, T>

Source§

type Item = (I, Cow<'a, T>)

The type of the elements being iterated over.
Source§

type IntoIter = StoredVecIterator<'a, I, T>

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

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<I, T> Freeze for EagerVec<I, T>

§

impl<I, T> !RefUnwindSafe for EagerVec<I, T>

§

impl<I, T> Send for EagerVec<I, T>
where I: Send, T: Send,

§

impl<I, T> Sync for EagerVec<I, T>
where I: Sync, T: Sync,

§

impl<I, T> Unpin for EagerVec<I, T>
where I: Unpin, T: Unpin,

§

impl<I, T> !UnwindSafe for EagerVec<I, T>

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<I, T, U> AnyCloneableIterableVec<I, T> for U
where U: 'static + AnyIterableVec<I, T> + Clone,

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: AnyVec + AnyIterableVec<I, T> + Clone, I: StoredIndex, T: StoredRaw,

Source§

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

Source§

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

Source§

fn i64_to_usize_(i: i64, len: usize) -> usize

Source§

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

Source§

fn collect_range_serde_json( &self, from: Option<usize>, to: Option<usize>, ) -> Result<Vec<Value>>

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<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<I, T, U> AnyStoredIterableVec<I, T> for U
where U: 'static + AnyIterableVec<I, T> + AnyStoredVec,