pub struct EagerVec<I, T> { /* private fields */ }Implementations§
Source§impl<I, T> EagerVec<I, T>where
I: StoredIndex,
T: StoredType,
impl<I, T> EagerVec<I, T>where
I: StoredIndex,
T: StoredType,
pub fn forced_import( path: &Path, value_name: &str, version: Version, format: Format, ) -> Result<Self>
pub fn forced_push_at(&mut self, index: I, value: T, exit: &Exit) -> Result<()>
pub fn safe_flush(&mut self, exit: &Exit) -> Result<()>
pub fn path(&self) -> &Path
pub fn get_or_read(&self, index: I, mmap: &Mmap) -> Result<Option<Value<'_, T>>>
pub fn mmap(&self) -> &ArcSwap<Mmap>
pub fn inner_version(&self) -> Version
pub fn validate_computed_version_or_reset_file( &mut self, version: Version, ) -> Result<()>
pub fn compute_to<F>( &mut self, max_from: I, to: usize, version: Version, t: F, exit: &Exit, ) -> Result<()>
pub fn compute_range<A, F>( &mut self, max_from: I, other: &impl AnyIterableVec<I, A>, t: F, exit: &Exit, ) -> Result<()>
pub fn compute_from_index<T2>(
&mut self,
max_from: I,
other: &impl AnyIterableVec<I, T2>,
exit: &Exit,
) -> Result<()>where
T: From<I>,
T2: StoredType,
pub fn compute_transform<A, B, F>( &mut self, max_from: A, other: &impl AnyIterableVec<A, B>, t: F, exit: &Exit, ) -> Result<()>
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>,
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,
pub fn compute_max<T2>( &mut self, max_from: I, source: &impl AnyIterableVec<I, T2>, exit: &Exit, ) -> Result<()>
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<()>
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: StoredType + Mul<usize, Output = T4>,
T3: StoredType,
T4: Div<T3, Output = T5> + From<T2>,
T5: CheckedSub<usize>,
T: From<T5>,
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: StoredType + Mul<usize, Output = T4>,
T3: StoredType,
T4: Div<T3, Output = T5> + From<T2>,
T5: CheckedSub<usize>,
T: From<T5>,
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: StoredType + Mul<usize, Output = T4>,
T3: StoredType,
T4: Div<T3, Output = T5> + From<T2>,
T5: CheckedSub<usize>,
T: From<T5>,
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: StoredType + Mul<usize, Output = T4>,
T3: StoredType,
T4: Div<T3, Output = T5> + From<T2>,
T5: CheckedSub<usize>,
T: From<T5>,
pub fn compute_drawdown( &mut self, max_from: I, close: &impl AnyIterableVec<I, Close<Dollars>>, ath: &impl AnyIterableVec<I, Dollars>, exit: &Exit, ) -> Result<()>
pub fn compute_inverse_more_to_less( &mut self, max_from: T, other: &impl AnyIterableVec<T, I>, exit: &Exit, ) -> Result<()>
pub fn compute_inverse_less_to_more(
&mut self,
max_from: T,
first_indexes: &impl AnyIterableVec<T, I>,
indexes_count: &impl AnyIterableVec<T, StoredUsize>,
exit: &Exit,
) -> Result<()>where
I: StoredType,
T: StoredIndex,
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: StoredType + StoredIndex + Copy + Add<usize, Output = T2> + CheckedSub<T2> + TryInto<T> + Default,
<T2 as TryInto<T>>::Error: Error + 'static,
T3: StoredType,
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: StoredType + StoredIndex + Copy + Add<usize, Output = T2> + CheckedSub<T2> + TryInto<T> + Default,
<T2 as TryInto<T>>::Error: Error + 'static,
T3: StoredType,
F: FnMut(T2) -> bool,
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<()>
pub fn compute_sum_from_indexes<T2>( &mut self, max_from: I, first_indexes: &impl AnyIterableVec<I, T2>, indexes_count: &impl AnyIterableVec<I, StoredUsize>, source: &impl AnyIterableVec<T2, T>, exit: &Exit, ) -> Result<()>
pub fn compute_sum_of_others( &mut self, max_from: I, others: &[&impl AnyIterableVec<I, T>], exit: &Exit, ) -> Result<()>
pub fn compute_min_of_others( &mut self, max_from: I, others: &[&impl AnyIterableVec<I, T>], exit: &Exit, ) -> Result<()>
pub fn compute_max_of_others( &mut self, max_from: I, others: &[&impl AnyIterableVec<I, T>], exit: &Exit, ) -> Result<()>
pub fn compute_sma<T2>( &mut self, max_from: I, source: &impl AnyIterableVec<I, T2>, sma: usize, exit: &Exit, ) -> Result<()>
pub fn compute_sma_<T2>( &mut self, max_from: I, source: &impl AnyIterableVec<I, T2>, sma: usize, exit: &Exit, min_i: Option<I>, ) -> Result<()>
pub fn compute_previous_value<T2>( &mut self, max_from: I, source: &impl AnyIterableVec<I, T2>, len: usize, exit: &Exit, ) -> Result<()>
pub fn compute_change( &mut self, max_from: I, source: &impl AnyIterableVec<I, T>, len: usize, exit: &Exit, ) -> Result<()>
pub fn compute_percentage_change<T2>( &mut self, max_from: I, source: &impl AnyIterableVec<I, T2>, len: usize, exit: &Exit, ) -> Result<()>
pub fn compute_cagr<T2>( &mut self, max_from: I, percentage_returns: &impl AnyIterableVec<I, T2>, days: usize, exit: &Exit, ) -> Result<()>
Source§impl EagerVec<DateIndex, Sats>
impl EagerVec<DateIndex, Sats>
pub fn compute_dca_stack_via_len( &mut self, max_from: DateIndex, closes: &impl AnyIterableVec<DateIndex, Close<Dollars>>, len: usize, exit: &Exit, ) -> Result<()>
pub fn compute_dca_stack_via_from( &mut self, max_from: DateIndex, closes: &impl AnyIterableVec<DateIndex, Close<Dollars>>, from: DateIndex, exit: &Exit, ) -> Result<()>
Source§impl EagerVec<DateIndex, Dollars>
impl EagerVec<DateIndex, Dollars>
pub fn compute_dca_avg_price_via_len( &mut self, max_from: DateIndex, stacks: &impl AnyIterableVec<DateIndex, Sats>, len: usize, exit: &Exit, ) -> Result<()>
pub fn compute_dca_avg_price_via_from( &mut self, max_from: DateIndex, stacks: &impl AnyIterableVec<DateIndex, Sats>, from: DateIndex, exit: &Exit, ) -> Result<()>
Source§impl<I> EagerVec<I, Bitcoin>where
I: StoredIndex,
impl<I> EagerVec<I, Bitcoin>where
I: StoredIndex,
pub fn compute_from_sats( &mut self, max_from: I, sats: &impl AnyIterableVec<I, Sats>, exit: &Exit, ) -> Result<()>
Source§impl<I> EagerVec<I, Dollars>where
I: StoredIndex,
impl<I> EagerVec<I, Dollars>where
I: StoredIndex,
pub fn compute_from_bitcoin( &mut self, max_from: I, bitcoin: &impl AnyIterableVec<I, Bitcoin>, price: &impl AnyIterableVec<I, Close<Dollars>>, exit: &Exit, ) -> Result<()>
Trait Implementations§
Source§impl<I, T> AnyCollectableVec for EagerVec<I, T>where
I: StoredIndex,
T: StoredType,
impl<I, T> AnyCollectableVec for EagerVec<I, T>where
I: StoredIndex,
T: StoredType,
Source§impl<I, T> AnyIterableVec<I, T> for EagerVec<I, T>where
I: StoredIndex,
T: StoredType,
impl<I, T> AnyIterableVec<I, T> for EagerVec<I, T>where
I: StoredIndex,
T: StoredType,
fn boxed_iter<'a>(&'a self) -> BoxedVecIterator<'a, I, T>where
I: StoredIndex,
T: StoredType + 'a,
fn iter<'a>(&'a self) -> BoxedVecIterator<'a, I, T>where
I: StoredIndex,
T: StoredType + 'a,
fn iter_at<'a>(&'a self, i: I) -> BoxedVecIterator<'a, I, T>where
I: StoredIndex,
T: StoredType + 'a,
fn iter_at_<'a>(&'a self, i: usize) -> BoxedVecIterator<'a, I, T>where
I: StoredIndex,
T: StoredType + 'a,
Source§impl<I, T> AnyVec for EagerVec<I, T>where
I: StoredIndex,
T: StoredType,
impl<I, T> AnyVec for EagerVec<I, T>where
I: StoredIndex,
T: StoredType,
Source§impl<'a, I, T> IntoIterator for &'a EagerVec<I, T>where
I: StoredIndex,
T: StoredType,
impl<'a, I, T> IntoIterator for &'a EagerVec<I, T>where
I: StoredIndex,
T: StoredType,
Auto Trait Implementations§
impl<I, T> Freeze for EagerVec<I, T>
impl<I, T> RefUnwindSafe for EagerVec<I, T>where
I: RefUnwindSafe,
T: RefUnwindSafe,
impl<I, T> Send for EagerVec<I, T>
impl<I, T> Sync for EagerVec<I, T>
impl<I, T> Unpin for EagerVec<I, T>
impl<I, T> UnwindSafe for EagerVec<I, T>where
I: UnwindSafe,
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<I, T, U> CloneableAnyIterableVec<I, T> for Uwhere
U: 'static + AnyIterableVec<I, T> + Clone,
impl<I, T, U> CloneableAnyIterableVec<I, T> for Uwhere
U: 'static + AnyIterableVec<I, T> + Clone,
fn boxed_clone(&self) -> Box<dyn CloneableAnyIterableVec<I, T>>
Source§impl<I, T, V> CollectableVec<I, T> for V
impl<I, T, V> CollectableVec<I, T> for V
fn collect_range( &self, from: Option<usize>, to: Option<usize>, ) -> Result<Vec<T>>
fn i64_to_usize(i: i64, len: usize) -> usize
fn range_count(from: Option<i64>, to: Option<i64>, len: usize) -> usize
fn collect_range_serde_json( &self, from: Option<i64>, to: Option<i64>, ) -> Result<Vec<Value>>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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