[][src]Struct rjwindow::Window

pub struct Window<T> { /* fields omitted */ }

Implementations

impl<T> Window<T>[src]

pub fn new(max_size: usize) -> Window<T>[src]

pub fn clear(&mut self)[src]

pub fn len(&self) -> usize[src]

pub fn extend(&mut self, data: Vec<T>)[src]

stacks the vector into the window taking ownership of items in vector.

pub fn stack(&mut self, data: T)[src]

stacks an item into the window remove the earliest item if the max size has been reached

pub fn get_mut(&mut self) -> &mut VecDeque<T>[src]

Returns a mutable reference to the internal deque.

pub fn get(&self) -> &VecDeque<T>[src]

Returns a reference to the internal deque.

pub fn peek(&self, amount: usize) -> VecDeque<&T>[src]

Retrieves references to the latest values up to the specified amount. The returned values could be less then this amount if there is not enough in the window.

pub fn pop(&mut self, amount: usize) -> VecDeque<T>[src]

Pops the latests values up to the specified amount taking ownership. The returned values could be less then this amount if there is not enough in the window.

Trait Implementations

impl<T: Debug> Debug for Window<T>[src]

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for Window<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> From<T> for T[src]

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

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.