pub struct PriceWindow { /* private fields */ }Expand description
Price window for computing position verification hash
Maintains a circular buffer of the last N prices for hash computation.
Implementations§
Source§impl PriceWindow
impl PriceWindow
Sourcepub fn push(&mut self, price: FixedPoint)
pub fn push(&mut self, price: FixedPoint)
Add a price to the window (circular buffer)
Sourcepub fn compute_hash(&self) -> u64
pub fn compute_hash(&self) -> u64
Compute hash of the price window using ahash
Returns a 64-bit hash that can be used to verify position in data stream.
Trait Implementations§
Source§impl Clone for PriceWindow
impl Clone for PriceWindow
Source§fn clone(&self) -> PriceWindow
fn clone(&self) -> PriceWindow
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PriceWindow
impl Debug for PriceWindow
Auto Trait Implementations§
impl Freeze for PriceWindow
impl RefUnwindSafe for PriceWindow
impl Send for PriceWindow
impl Sync for PriceWindow
impl Unpin for PriceWindow
impl UnwindSafe for PriceWindow
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