Struct mortal::screen::ScreenReadGuard
[−]
[src]
pub struct ScreenReadGuard<'a>(_);
Holds an exclusive lock for read operations on a Screen
See Screen
documentation for details on locking.
Methods
impl<'a> ScreenReadGuard<'a>
[src]
pub fn wait_event(&mut self, timeout: Option<Duration>) -> Result<bool>
[src]
Waits for an event from the terminal.
Returns Ok(false)
if timeout
elapses without an event occurring.
If timeout
is None
, this method will wait indefinitely.
Notes
Some low-level terminal events may not generate an Event
value.
Therefore, this method may return Ok(true)
, while a follow-up call
to read_event
may not immediately return an event.
pub fn read_event(&mut self, timeout: Option<Duration>) -> Result<Option<Event>>
[src]
Reads an event from the terminal.
If timeout
elapses without an event occurring, this method will return
Ok(None)
.
If timeout
is None
, this method will wait indefinitely.