Struct debounce::buffer::EventBuffer
source · pub struct EventBuffer<T> { /* private fields */ }
Expand description
Debouncing buffer with a common delay for all events. Accepts events via EventBuffer::put() which tracks the time of events and de-duplicates them against the current buffer content. Subsequent call to EventBuffer::get () which returns the State of the buffer.
Implemented on top of a VecDeque and should be slightly more preformant than MixedEventBuffer.
Implementations§
source§impl<T: PartialEq> EventBuffer<T>
impl<T: PartialEq> EventBuffer<T>
Trait Implementations§
source§impl<T> Get for EventBuffer<T>
impl<T> Get for EventBuffer<T>
type Data = T
source§fn get(&mut self) -> State<T>
fn get(&mut self) -> State<T>
Attemtps to get the next element out of a buffer. If an element is
State::Ready it’s removed from the buffer.
source§fn 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.
Auto Trait Implementations§
impl<T> RefUnwindSafe for EventBuffer<T>where T: RefUnwindSafe,
impl<T> Send for EventBuffer<T>where T: Send,
impl<T> Sync for EventBuffer<T>where T: Sync,
impl<T> Unpin for EventBuffer<T>where T: Unpin,
impl<T> UnwindSafe for EventBuffer<T>where T: UnwindSafe,
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