pub struct SliceSource<'a> { /* private fields */ }Expand description
An InputSource that replays a fixed slice of events once.
Useful for deterministic tests and for scripted headless playback without
requiring alloc.
Implementations§
Source§impl<'a> SliceSource<'a>
impl<'a> SliceSource<'a>
Sourcepub fn new(events: &'a [InputEvent]) -> Self
pub fn new(events: &'a [InputEvent]) -> Self
Creates a source that yields events in order, then None.
Trait Implementations§
Source§impl InputSource for SliceSource<'_>
impl InputSource for SliceSource<'_>
Source§fn poll_event(&mut self) -> Option<InputEvent>
fn poll_event(&mut self) -> Option<InputEvent>
Returns the next pending event, or
None when the source is drained
for this poll. Must not block.Auto Trait Implementations§
impl<'a> Freeze for SliceSource<'a>
impl<'a> RefUnwindSafe for SliceSource<'a>
impl<'a> Send for SliceSource<'a>
impl<'a> Sync for SliceSource<'a>
impl<'a> Unpin for SliceSource<'a>
impl<'a> UnsafeUnpin for SliceSource<'a>
impl<'a> UnwindSafe for SliceSource<'a>
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