pub enum InputSource {
Terminal,
Custom(Pin<Box<dyn AsyncRead + Send + Unpin>>),
}Expand description
Represents different input sources that the InputHandler can read from.
This enum allows the program to read input from either the standard crossterm event stream (for regular terminal input) or from a custom async reader.
Variants§
Terminal
Standard terminal input using crossterm’s event stream. This is the default and handles keyboard, mouse, and resize events.
Custom(Pin<Box<dyn AsyncRead + Send + Unpin>>)
Custom input reader that implements AsyncRead + Send + Unpin.
This allows reading input from files, network streams, or other sources.
The custom reader is expected to provide line-based input.
Auto Trait Implementations§
impl Freeze for InputSource
impl !RefUnwindSafe for InputSource
impl Send for InputSource
impl !Sync for InputSource
impl Unpin for InputSource
impl !UnwindSafe for InputSource
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