Get

Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> Get for EventBuffer<T>

Source§

type Data = T

Source§

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

Source§

type Data = T