Struct crossterm::terminal::EnterAlternateScreen
source · [−]pub struct EnterAlternateScreen;
Expand description
A command that switches to alternate screen.
Notes
- Commands must be executed/queued for execution otherwise they do nothing.
- Use LeaveAlternateScreen command to leave the entered alternate screen.
Examples
use std::io::{stdout, Write};
use crossterm::{execute, Result, terminal::{EnterAlternateScreen, LeaveAlternateScreen}};
fn main() -> Result<()> {
execute!(stdout(), EnterAlternateScreen)?;
// Do anything on the alternate screen
execute!(stdout(), LeaveAlternateScreen)
}
Trait Implementations
sourceimpl Clone for EnterAlternateScreen
impl Clone for EnterAlternateScreen
sourcefn clone(&self) -> EnterAlternateScreen
fn clone(&self) -> EnterAlternateScreen
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Command for EnterAlternateScreen
impl Command for EnterAlternateScreen
sourcefn write_ansi(&self, f: &mut impl Write) -> Result
fn write_ansi(&self, f: &mut impl Write) -> Result
Write an ANSI representation of this command to the given writer. An ANSI code can manipulate the terminal by writing it to the terminal buffer. However, only Windows 10 and UNIX systems support this. Read more
sourceimpl Debug for EnterAlternateScreen
impl Debug for EnterAlternateScreen
impl Copy for EnterAlternateScreen
impl Eq for EnterAlternateScreen
impl StructuralEq for EnterAlternateScreen
impl StructuralPartialEq for EnterAlternateScreen
Auto Trait Implementations
impl RefUnwindSafe for EnterAlternateScreen
impl Send for EnterAlternateScreen
impl Sync for EnterAlternateScreen
impl Unpin for EnterAlternateScreen
impl UnwindSafe for EnterAlternateScreen
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more