[−][src]Struct crossterm_screen::AlternateScreen
An alternate screen.
With this type, you will be able to switch to the alternate screen and then back to the main screen.
Be aware that you'll be switched back to the main screen when you drop the
AlternateScreen
value.
It's recommended to use the command API. See the
EnterAlternateScreen
and LeaveAlternateScreen
commands documentation for more info.
Examples
Alternate screen with raw mode enabled:
use crossterm_screen::AlternateScreen; use crossterm_utils::Result; fn main() -> Result<()> { let _alternate = AlternateScreen::to_alternate(true)?; // Do something on the alternate screen in the raw mode Ok(()) } // `_alternate` dropped here <- raw mode disabled & back to main screen
Methods
impl AlternateScreen
[src]
pub fn to_alternate(raw_mode: bool) -> Result<AlternateScreen>
[src]
Switches to the alternate screen.
Arguments
raw_mode
-true
enables the raw mode as well
Notes
You'll be automatically switched to the main screen if this function fails.
pub fn to_main(&self) -> Result<()>
[src]
Switches to the main screen.
Trait Implementations
impl Drop for AlternateScreen
[src]
Auto Trait Implementations
impl Send for AlternateScreen
impl Sync for AlternateScreen
impl Unpin for AlternateScreen
impl UnwindSafe for AlternateScreen
impl RefUnwindSafe for AlternateScreen
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,