Struct prototty_unix::Context
source · pub struct Context { /* private fields */ }
Expand description
An interface to a terminal for rendering View
s, and getting input.
Implementations§
source§impl Context
impl Context
pub fn drain_input(&mut self) -> Result<Drain<'_, Input>>
sourcepub fn poll_input(&mut self) -> Result<Option<Input>>
pub fn poll_input(&mut self) -> Result<Option<Input>>
Gets an input event from the terminal if one is present, returning immediately.
sourcepub fn wait_input(&mut self) -> Result<Input>
pub fn wait_input(&mut self) -> Result<Input>
Gets an input event from the terminal, waiting until an event occurs.
sourcepub fn wait_input_timeout(&mut self, timeout: Duration) -> Result<Option<Input>>
pub fn wait_input_timeout(&mut self, timeout: Duration) -> Result<Option<Input>>
Gets an input event from the terminal, waiting until
either an event occurs, or the timeout expires, in which
case this method returns None
.