Struct requestty_ui::events::TestEvents
source · [−]Expand description
A simple wrapper around a KeyEvent iterator that can be used in tests.
Even though EventIterator expects the iterator to be infinite, only having enough events to
complete the test is necessary.
It will also check that the internal iterator is fully exhausted on Drop.
Panics
It will panic if the events run out next_event is called, or if there are events remaining
when dropped.
Implementations
sourceimpl<E: Iterator<Item = KeyEvent>> TestEvents<E>
impl<E: Iterator<Item = KeyEvent>> TestEvents<E>
sourcepub fn new<I: IntoIterator<IntoIter = E, Item = KeyEvent>>(iter: I) -> Self
pub fn new<I: IntoIterator<IntoIter = E, Item = KeyEvent>>(iter: I) -> Self
Create a new TestEvents
Trait Implementations
sourceimpl<E: Clone + Iterator<Item = KeyEvent>> Clone for TestEvents<E>
impl<E: Clone + Iterator<Item = KeyEvent>> Clone for TestEvents<E>
sourcefn clone(&self) -> TestEvents<E>
fn clone(&self) -> TestEvents<E>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<E: Iterator<Item = KeyEvent>> Drop for TestEvents<E>
impl<E: Iterator<Item = KeyEvent>> Drop for TestEvents<E>
sourceimpl<E: Iterator<Item = KeyEvent>> EventIterator for TestEvents<E>
impl<E: Iterator<Item = KeyEvent>> EventIterator for TestEvents<E>
sourcefn next_event(&mut self) -> Result<KeyEvent>
fn next_event(&mut self) -> Result<KeyEvent>
Get the next event
Auto Trait Implementations
impl<E> RefUnwindSafe for TestEvents<E> where
E: RefUnwindSafe,
impl<E> Send for TestEvents<E> where
E: Send,
impl<E> Sync for TestEvents<E> where
E: Sync,
impl<E> Unpin for TestEvents<E> where
E: Unpin,
impl<E> UnwindSafe for TestEvents<E> where
E: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more