Skip to main content

RenderCommand

Enum RenderCommand 

Source
pub enum RenderCommand {
    FullRedraw(Box<Buffer>),
    Update(Box<Buffer>),
    Resize {
        width: u16,
        height: u16,
    },
    SetCursor {
        x: Option<u16>,
        y: u16,
    },
    RawOutput {
        bytes: Vec<u8>,
    },
    Shutdown,
}
Expand description

Commands sent to the render thread.

Variants§

§

FullRedraw(Box<Buffer>)

Request a full redraw with new buffer content.

§

Update(Box<Buffer>)

Request a diff-based update. Request a diff-based update with new buffer content.

§

Resize

Resize the buffers.

Fields

§width: u16

New width.

§height: u16

New height.

§

SetCursor

Set the cursor position and visibility.

Fields

§x: Option<u16>

X position (None = hide cursor).

§y: u16

Y position.

§

RawOutput

Write raw bytes directly to the terminal output.

This is used for the “Fast Path” optimization: directly writing generated ANSI sequences without going through the diffing engine.

Warning: The caller is responsible for ensuring these bytes do not corrupt the terminal state or contradict the buffer state.

Fields

§bytes: Vec<u8>

The raw bytes to write.

§

Shutdown

Shutdown the render thread.

Trait Implementations§

Source§

impl Debug for RenderCommand

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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.