pub struct Termfest { /* private fields */ }
Expand description
Termfest
holds termfest states.
It is created by Termfest::hold
.
When it is dropped, termfest finalizes and restores every terminal states.
Implementations
sourceimpl Termfest
impl Termfest
sourcepub fn hold() -> Result<(Termfest, Receiver<Event>), Error>
pub fn hold() -> Result<(Termfest, Receiver<Event>), Error>
hold
initialize terminal state and termfest state.
If succeeded, it returns a tuple of Termfest
object and Receiver<Event>
.
When the returned Termfest
object is dropped, the terminal state will be restored.
use termfest::Termfest;
let (fest, events) = Termfest::hold()?;
// do something widht fest and events.
sourcepub fn lock_screen(&self) -> ScreenLock<'_>
pub fn lock_screen(&self) -> ScreenLock<'_>
acquire the lock of screen, and returns ScreenLock
.
It will block if the lock is already acquired.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Termfest
impl Send for Termfest
impl Sync for Termfest
impl Unpin for Termfest
impl UnwindSafe for Termfest
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more