pub struct ViewCopyMode { /* private fields */ }Expand description
Handle for View/Copy mode
Created by ViewCopyMode::enter(), must call exit() when done.
Implementations§
Source§impl ViewCopyMode
impl ViewCopyMode
Sourcepub fn enter<W: Write>(stdout: &mut W) -> Result<Self>
pub fn enter<W: Write>(stdout: &mut W) -> Result<Self>
Enter View/Copy mode
This will:
- Leave the alternate screen
- Disable mouse capture
- Clear the screen and scrollback buffer
- Disable raw mode (so println works normally)
Sourcepub fn enter_with_config<W: Write>(
stdout: &mut W,
config: ViewCopyConfig,
) -> Result<Self>
pub fn enter_with_config<W: Write>( stdout: &mut W, config: ViewCopyConfig, ) -> Result<Self>
Enter View/Copy mode with custom configuration
Sourcepub fn print_lines(&self, lines: &[String]) -> Result<()>
pub fn print_lines(&self, lines: &[String]) -> Result<()>
Print lines to stdout with optional header and hints
Sourcepub fn wait_for_input(&self) -> Result<ViewCopyAction>
pub fn wait_for_input(&self) -> Result<ViewCopyAction>
Wait for user input and return the action
Note: This temporarily enables raw mode to catch keypresses, then disables it again so subsequent prints work.
Auto Trait Implementations§
impl Freeze for ViewCopyMode
impl RefUnwindSafe for ViewCopyMode
impl Send for ViewCopyMode
impl Sync for ViewCopyMode
impl Unpin for ViewCopyMode
impl UnwindSafe for ViewCopyMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more