Skip to main content

InlineTerminal

Struct InlineTerminal 

Source
pub struct InlineTerminal { /* private fields */ }
Available on crate feature crossterm only.
Expand description

Concrete crossterm terminal backends, exposed (issue #278) so external integrations can drive SLT’s render pipeline with their own event loop — pair with event::from_crossterm. Most apps should use run / run_inline, which build and drive these internally. Inline crossterm terminal backend: renders into a fixed-height region below the cursor instead of taking over the whole screen.

Like Terminal, exposed (issue #278) for custom integrations. Backs the crate::run_inline entry point.

Implementations§

Source§

impl InlineTerminal

Source

pub fn new( height: u32, mouse: bool, kitty_keyboard: bool, report_all_keys: bool, color_depth: ColorDepth, ) -> Result<Self>

Construct an inline terminal backend that renders height rows below the current cursor without entering the alternate screen. Optionally enables mouse capture and the kitty keyboard protocol. When report_all_keys is set (and kitty_keyboard is too), bare modifier presses are reported.

Source

pub fn size(&self) -> (u32, u32)

Return the inline terminal’s current (cols, rows).

Source

pub fn buffer_mut(&mut self) -> &mut Buffer

Mutable access to the back buffer used by the next render pass.

Source

pub fn flush(&mut self) -> Result<()>

Diff the back buffer against the front buffer, write changed cells to stdout under a synchronized-output guard at the inline rows reserved below the cursor, then swap buffers.

Source

pub fn handle_resize(&mut self) -> Result<()>

Re-query the terminal size and resize the inline buffers to match the new column count, preserving the inline row height.

Trait Implementations§

Source§

impl Backend for InlineTerminal

Source§

fn size(&self) -> (u32, u32)

Returns the current display size as (width, height) in cells.
Source§

fn buffer_mut(&mut self) -> &mut Buffer

Returns a mutable reference to the display buffer. Read more
Source§

fn flush(&mut self) -> Result<()>

Flush the buffer contents to the display. Read more
Source§

impl Drop for InlineTerminal

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.