pub struct PushBackend { /* private fields */ }Expand description
A Backend a host pushes to: see the module docs.
It paints on the alternate screen unless told otherwise
(inline), never reads (driving it with
EventLoop::run fails with
Unsupported), has a clipboard whose
copies the host takes (PushPort::take_copies), and runs no command:
a hand-off returns at once with no exit code.
Implementations§
Source§impl PushBackend
impl PushBackend
Sourcepub fn new(columns: u16, rows: u16) -> PushBackend
pub fn new(columns: u16, rows: u16) -> PushBackend
A columns x rows screen, at time zero.
Sourcepub fn inline(self) -> PushBackend
pub fn inline(self) -> PushBackend
Paint inline, from the row the host’s cursor is on, instead of on the alternate screen.
Trait Implementations§
Source§impl Backend for PushBackend
impl Backend for PushBackend
Source§fn read(&mut self, _timeout: Option<Duration>) -> Result<Option<Event>>
fn read(&mut self, _timeout: Option<Duration>) -> Result<Option<Event>>
The next event, or
None when timeout passes first. None for
timeout waits as long as it takes.Source§fn elapsed(&self) -> Duration
fn elapsed(&self) -> Duration
Time since the backend started (virtual in the headless driver).
Source§fn handoff(&mut self, _command: &mut Command) -> Result<Option<i32>>
fn handoff(&mut self, _command: &mut Command) -> Result<Option<i32>>
Run
command with the terminal as it was before the session, then
take the terminal back. Returns the exit code.Source§fn alternate_screen(&self) -> bool
fn alternate_screen(&self) -> bool
Whether the region is the alternate screen (painted from the top).
Source§fn clipboard(&self) -> Result<(), String>
fn clipboard(&self) -> Result<(), String>
Whether
copy reaches a clipboard (#488): Ok
when it does, or why not. The default: it does not.Source§fn synchronized_output(&self) -> bool
fn synchronized_output(&self) -> bool
Whether
write_frame writes each frame as
one synchronized update. The default: no.Source§fn write_frame(&mut self, frame: &str) -> Result<()>
fn write_frame(&mut self, frame: &str) -> Result<()>
Write a frame the painter made: nothing at all when it is empty,
and with
synchronized_output
between CSI ? 2026 h and CSI ? 2026 l, in the one write.Source§fn origin(&self) -> u16
fn origin(&self) -> u16
The terminal row an inline region started on, for placing mouse
events; 0 when unknown. The alternate screen always starts at 0.
Source§fn painted(&mut self, text: &str)
fn painted(&mut self, text: &str)
The plain text of a view just painted: the headless driver records
it.
Source§fn can_suspend(&self) -> bool
fn can_suspend(&self) -> bool
Whether Ctrl+Z suspends (a real terminal on Unix), rather than
reaching the component as a key.
Source§fn suspend(&mut self) -> Result<()>
fn suspend(&mut self) -> Result<()>
Give the terminal back, stop until the shell continues the process,
then take the terminal back. Only called when
can_suspend.Source§fn take_resumed(&mut self) -> bool
fn take_resumed(&mut self) -> bool
Whether the process was suspended from outside (SIGTSTP) and has
continued since the last call: the screen is then the shell’s.
Source§fn releases_reported(&self) -> Releases
fn releases_reported(&self) -> Releases
Which key releases the backend reports (see
Releases). The default: none.Auto Trait Implementations§
impl !RefUnwindSafe for PushBackend
impl !Send for PushBackend
impl !Sync for PushBackend
impl !UnwindSafe for PushBackend
impl Freeze for PushBackend
impl Unpin for PushBackend
impl UnsafeUnpin for PushBackend
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