Struct mortal::screen::ScreenReadGuard
source · pub struct ScreenReadGuard<'a>(_);
Expand description
Holds an exclusive lock for read operations on a Screen
See Screen
documentation for details on locking.
Implementations§
source§impl<'a> ScreenReadGuard<'a>
impl<'a> ScreenReadGuard<'a>
sourcepub fn wait_event(&mut self, timeout: Option<Duration>) -> Result<bool>
pub fn wait_event(&mut self, timeout: Option<Duration>) -> Result<bool>
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.