Skip to main content

RenderOp

Enum RenderOp 

Source
pub enum RenderOp {
Show 18 variants Clear, ClearLine { y: u16, }, ClearEol { x: u16, y: u16, }, ClearBol { x: u16, y: u16, }, ClearEos { x: u16, y: u16, }, ClearRect { x: u16, y: u16, w: u16, h: u16, }, Put { x: u16, y: u16, text: String, style: Style, }, PutGlyph { x: u16, y: u16, glyph: String, style: Style, }, Label { x: u16, y: u16, w: u16, text: String, style: Style, truncate: TruncateMode, }, LabelStyled { x: u16, y: u16, w: u16, spans: Vec<Span>, truncate: TruncateMode, }, PutStyled { x: u16, y: u16, w: u16, spans: Vec<Span>, truncate: TruncateMode, }, PutWrapped { x: u16, y: u16, w: u16, text: String, style: Style, }, PutWrappedStyled { x: u16, y: u16, w: u16, spans: Vec<Span>, wrap_opts: WrapOpts, max_lines: Option<u16>, }, Blit { x: u16, y: u16, w: u16, h: u16, cells: Vec<Option<BlitCell>>, }, FillRect { x: u16, y: u16, w: u16, h: u16, style: Style, }, HLine { x: u16, y: u16, len: u16, glyph: String, style: Style, }, VLine { x: u16, y: u16, len: u16, glyph: String, style: Style, }, Box { x: u16, y: u16, w: u16, h: u16, style: Style, charset: BoxCharset, },
}

Variants§

§

Clear

Clear the entire grid to empty cells.

§

ClearLine

Clear a full line (row) to plain spaces.

This is rendered as plain spaces rather than Cell::Empty to avoid style bleed from earlier styled cells on the same line.

Fields

§

ClearEol

Clear from (x,y) to end-of-line (inclusive) to plain spaces.

This mirrors ANSI EL (erase in line) mode 0.

Fields

§

ClearBol

Clear from start-of-line to (x,y) (inclusive) to plain spaces.

This mirrors ANSI EL (erase in line) mode 1.

Fields

§

ClearEos

Clear from (x,y) to end-of-screen (inclusive) to plain spaces.

This mirrors ANSI ED (erase in display) mode 0.

Fields

§

ClearRect

Clear a rectangle to plain spaces.

This is semantically equivalent to FillRect with a plain style.

Fields

§

Put

Put text at a coordinate.

Fields

§text: String
§style: Style
§

PutGlyph

Put a single glyph (grapheme cluster) at a coordinate.

Fields

§glyph: String
§style: Style
§

Label

Put a single-line label, clipped to w cells.

This is a convenience op for common UI labels.

Fields

§w: u16

Maximum width in cells.

§text: String
§style: Style
§truncate: TruncateMode
§

LabelStyled

Put a single-line styled label (spans), clipped to w cells.

This op is analogous to Label but supports inline styling.

Fields

§w: u16

Maximum width in cells.

§spans: Vec<Span>
§truncate: TruncateMode
§

PutStyled

Put a single-line styled label (spans), clipped to w cells.

This op is useful for UI where inline styling is needed (for example, highlighted search matches or mixed emphasis).

Fields

§w: u16

Maximum width in cells.

§spans: Vec<Span>
§truncate: TruncateMode
§

PutWrapped

Put wrapped text within w cells, flowing downward from (x,y).

Wrapping is whitespace-aware with hard-break fallback for long words.

Fields

§w: u16

Wrap width in cells.

§text: String
§style: Style
§

PutWrappedStyled

Put wrapped styled text (spans) within w cells, flowing downward from (x,y).

Wrapping is whitespace-aware with hard-break fallback for long tokens. Use wrap_opts to control whitespace preservation and trimming.

Fields

§w: u16

Wrap width in cells.

§spans: Vec<Span>
§wrap_opts: WrapOpts
§max_lines: Option<u16>

Optional maximum number of visual lines to render.

§

Blit

Blit (copy) a small source cell-map onto the grid.

  • cells is a row-major array of length w*h.
  • null cells are transparent (leave destination unchanged).
  • Wide glyphs (width=2) occupy two destination cells; the next source cell in that row is ignored.

Fields

§

FillRect

Fill a rectangle with styled spaces.

Use this for clearing regions and for background fills.

Fields

§style: Style
§

HLine

Draw a horizontal line using a single glyph.

len is measured in cells. For width=2 glyphs, placement will stop when fewer than 2 cells remain.

Fields

§len: u16
§glyph: String
§style: Style
§

VLine

Draw a vertical line using a single glyph.

len is measured in rows.

Fields

§len: u16
§glyph: String
§style: Style
§

Box

Draw a bordered box.

The box is clipped to the grid bounds.

Fields

§style: Style
§charset: BoxCharset

Trait Implementations§

Source§

impl Clone for RenderOp

Source§

fn clone(&self) -> RenderOp

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RenderOp

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for RenderOp

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for RenderOp

Source§

fn eq(&self, other: &RenderOp) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for RenderOp

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for RenderOp

Source§

impl StructuralPartialEq for RenderOp

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,