pub struct TimeSeries<T: Display + PartialEq<T>> { /* private fields */ }Implementations§
Source§impl<T: Display + PartialEq<T>> TimeSeries<T>
impl<T: Display + PartialEq<T>> TimeSeries<T>
pub fn new(initial_value: T) -> Self
pub fn iter(&self) -> impl Iterator<Item = (Option<BlockHeight>, &T)>
pub fn get(&self, height: BlockHeight) -> &T
pub fn is_empty(&self) -> bool
pub fn latest_value(&self) -> &T
pub fn latest_height(&self) -> Option<BlockHeight>
pub fn apply<D: Display>( &mut self, height: BlockHeight, value: T, context: impl FnOnce() -> D, ) -> Result<()>
pub fn revert<D: Display>( &mut self, height: BlockHeight, value: T, context: impl FnOnce() -> D, ) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for TimeSeries<T>where
T: Freeze,
impl<T> RefUnwindSafe for TimeSeries<T>where
T: RefUnwindSafe,
impl<T> Send for TimeSeries<T>where
T: Send,
impl<T> Sync for TimeSeries<T>where
T: Sync,
impl<T> Unpin for TimeSeries<T>where
T: Unpin,
impl<T> UnwindSafe for TimeSeries<T>where
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