Skip to main content

Recording

Struct Recording 

Source
pub struct Recording {
    pub events: Vec<Event>,
}
Expand description

Records parser events into a Vec<Event> (the enum-based, trait-free API).

The crate::Perform callback path is the zero-allocation hot path; this recording allocates one Event per dispatch, for tests and tooling.

Fields§

§events: Vec<Event>

Decoded events in dispatch order.

Implementations§

Source§

impl Recording

Source

pub const DEFAULT: Self

Compile-time default: an empty recording.

Source

pub const fn new() -> Self

An empty recording (no events).

Trait Implementations§

Source§

impl Debug for Recording

Source§

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

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

impl Default for Recording

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Perform for Recording

Source§

fn print(&mut self, c: char)

A single printable non-ASCII code point (UTF-8 decoded).
Source§

fn print_bytes(&mut self, s: &[u8])

A contiguous run of printable ASCII (0x20..=0x7e) — display text, the bulk hot path. Valid UTF-8 by construction, so implementations may std::str::from_utf8_unchecked without re-validating.
Source§

fn execute(&mut self, byte: u8)

A C0/C1 control byte (e.g. \n, \t, \x1b).
Source§

fn csi_dispatch( &mut self, params: &[i32], _sep: u16, intermediates: &[u8], final_byte: u8, )

A CSI sequence’s final byte, with collected parameters and intermediates (private markers ? > = < + 0x20..0x2f). Params are i32, clamped to 0..=65535; an empty colon param is the -1 sentinel. sep records : separators: bit i is set when param i is followed by a colon (4:2 vs 4;2). Default: ignore.
Source§

fn esc_dispatch(&mut self, intermediates: &[u8], byte: u8)

An escape sequence’s final byte. Default: ignore.
Source§

fn hook(&mut self, params: &[i32], intermediates: &[u8], final_byte: u8)

A device-control string header arrived. Parameters are i32 (see csi_dispatch). Default: ignore.
Source§

fn put(&mut self, byte: u8)

A device-control string payload byte arrived. Raw — arbitrary, not necessarily UTF-8 (Sixel raster, kitty graphics, base64). Default: ignore.
Source§

fn unhook(&mut self)

The device-control string ended. Default: ignore.
Source§

fn osc_dispatch(&mut self, params: &[&[u8]], bell_terminated: bool)

An operating-system command ended (params split on ;). Default: ignore.
Source§

fn print_codepoints(&mut self, codepoints: &[u32])

A contiguous run of pre-decoded printable code points — the non-ASCII bulk hot path, never C0/C1 controls. The default loops over print; bulk cell writers can specialize to skip per-char dispatch.
Source§

fn put_slice(&mut self, bytes: &[u8])

A contiguous DCS payload run — raw bytes, like put. Bulk form of put; the default loops over it. Cross-byte decoders (e.g. sixel) can keep the per-byte form.

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.