[][src]Struct yata::methods::Past

pub struct Past<T>(_)
where
    T: Sized + Copy + Default + Debug
;

Moves timeseries by length items forward

It's just a simple method-like wrapper for Window<T>

Parameters

Has a single parameter length: PeriodType

length should be > 0

Input type

Input type is ValueType

Output type

Output type is ValueType

Examples

use yata::prelude::*;
use yata::methods::Past;

// Move of length=3
let mut past = Past::new(3, 1.0);

past.next(1.0);
past.next(2.0);
past.next(3.0);

assert_eq!(past.next(4.0), 1.0);
assert_eq!(past.next(5.0), 2.0);
assert_eq!(past.next(6.0), 3.0);

Perfomance

O(1)

See also

Window<T>

Trait Implementations

impl<T: Clone> Clone for Past<T> where
    T: Sized + Copy + Default + Debug
[src]

impl<T: Debug> Debug for Past<T> where
    T: Sized + Copy + Default + Debug
[src]

impl<'de, T> Deserialize<'de> for Past<T> where
    T: Sized + Copy + Default + Debug,
    T: Deserialize<'de>, 
[src]

impl<T> Method for Past<T> where
    T: Sized + Copy + Default + Debug
[src]

type Params = PeriodType

Method parameters

type Input = T

Input value type

type Output = T

Output value type

impl<T> Serialize for Past<T> where
    T: Sized + Copy + Default + Debug,
    T: Serialize
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Past<T> where
    T: RefUnwindSafe

impl<T> Send for Past<T> where
    T: Send

impl<T> Sync for Past<T> where
    T: Sync

impl<T> Unpin for Past<T> where
    T: Unpin

impl<T> UnwindSafe for Past<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.