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§
sourcefn get(&mut self) -> State<Self::Data>
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§
sourcefn iter(&mut self) -> BufferIter<'_, Self> ⓘ
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.