Trait debounce::buffer::Get

source ·
pub trait Get: Sized {
    type Data;

    // Required method
    fn get(&mut self) -> State<Self::Data>;

    // Provided method
    fn iter(&mut self) -> BufferIter<'_, Self>  { ... }
}
Expand description

Common interface for getting events out of debouncing buffers.

Required Associated Types§

Required Methods§

source

fn get(&mut self) -> State<Self::Data>

Attemtps to get the next element out of a buffer. If an element is State::Ready it’s removed from the buffer.

Provided Methods§

source

fn iter(&mut self) -> BufferIter<'_, Self>

Returns an iterator over all State::Ready elements of the buffer. Stops when either the next element is in State::Wait or the buffer is State::Empty.

Implementors§

source§

impl<T> Get for EventBuffer<T>

§

type Data = T

source§

impl<T: Eq> Get for MixedEventBuffer<T>

§

type Data = T