pub struct EventReader { /* private fields */ }Expand description
Reads events from stdin asynchronously.
Uses a background thread to read raw bytes from stdin and parse them into events. Events are sent through a channel.
Implementations§
Source§impl EventReader
impl EventReader
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Create a new event reader.
Spawns a background thread that reads from stdin in raw mode and parses events.
Sourcepub fn start(&self)
pub fn start(&self)
Start reading events from stdin.
This spawns a background thread that reads raw bytes from stdin and sends parsed events through the channel.
Sourcepub fn recv_timeout(&self, timeout: Duration) -> Option<Event>
pub fn recv_timeout(&self, timeout: Duration) -> Option<Event>
Try to receive an event with a timeout.
Auto Trait Implementations§
impl !Sync for EventReader
impl Freeze for EventReader
impl RefUnwindSafe for EventReader
impl Send for EventReader
impl Unpin for EventReader
impl UnsafeUnpin for EventReader
impl UnwindSafe for EventReader
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