VtEvent

Enum VtEvent 

Source
#[non_exhaustive]
pub enum VtEvent<'m> { Print(u8char), PrintEnd, ExecuteCtrl(u8), DispatchCsi { cmd: u8, params: &'m [u16], intermediates: &'m [u8], }, DispatchEsc { cmd: u8, intermediates: &'m [u8], }, DcsStart { cmd: u8, params: &'m [u16], intermediates: &'m [u8], }, DcsChar(u8char), DcsEnd(u8), OscStart(u8), OscChar(u8char), OscEnd(u8), Error(u8char), }
Expand description

An event from VtMachine.

Some event types include borrowed values from inside the VtMachine’s mutable state, and so all events must be dropped before writing another character to the machine.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Print(u8char)

Print a literal character at the current cursor position.

§

PrintEnd

Emitted at the end of a series of consecutive VtEvent::Print events before emitting any other event, so that a terminal that is attempting to handle Unicode grapheme clusters can treat the transition points as “end-of-text” to reset the segmentation state machine.

§

ExecuteCtrl(u8)

Execute an appropriate action for the given control character.

§

DispatchCsi

Execute an appropriate action for the given control sequence.

This is for sequence starting with the control sequence introducer, ESC[, and terminated with the byte given in cmd.

Fields

§cmd: u8

The symbol at the end of the sequence representing the command to perform.

§params: &'m [u16]

The semicolon-separated integer parameters.

§intermediates: &'m [u8]

Any intermediate characters that appeared inside the sequence.

§

DispatchEsc

Fields

§cmd: u8
§intermediates: &'m [u8]
§

DcsStart

Reports the beginning of a device control string.

Events of this type are followed by zero or more VtEvent::DcsChar and then one VtEvent::DcsEnd, when the input stream is valid.

Fields

§cmd: u8
§params: &'m [u16]
§intermediates: &'m [u8]
§

DcsChar(u8char)

Reports a literal character from within the “data string” portion of a device control string sequence.

§

DcsEnd(u8)

Marks the end of a device control string, reporting the character that ended it, which should be the “string terminator” character.

§

OscStart(u8)

Reports the beginning of an operating system command.

Events of this type are followed by zero or more VtEvent::OscChar and then one VtEvent::OscEnd, when the input stream is valid.

§

OscChar(u8char)

Reports a literal character from within an operating system command.

§

OscEnd(u8)

Marks the end of an operating system command, reporting the character that ended it.

§

Error(u8char)

Emitted whenever the state machine encounters a character that is not expected in its current state.

Trait Implementations§

Source§

impl<'m> Clone for VtEvent<'m>

Source§

fn clone(&self) -> VtEvent<'m>

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<'m> Debug for VtEvent<'m>

Source§

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

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

impl<'m> PartialEq for VtEvent<'m>

Source§

fn eq(&self, other: &VtEvent<'m>) -> 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<'m> Copy for VtEvent<'m>

Source§

impl<'m> Eq for VtEvent<'m>

Source§

impl<'m> StructuralPartialEq for VtEvent<'m>

Auto Trait Implementations§

§

impl<'m> Freeze for VtEvent<'m>

§

impl<'m> RefUnwindSafe for VtEvent<'m>

§

impl<'m> Send for VtEvent<'m>

§

impl<'m> Sync for VtEvent<'m>

§

impl<'m> Unpin for VtEvent<'m>

§

impl<'m> UnwindSafe for VtEvent<'m>

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, 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.