[−]Struct xterm_js_sys::xterm::FunctionIdentifier
Data type to register a CSI
, DCS
, or ESC
callback in the parser in the
form:
- ESC I..I F
- CSI Prefix P..P I..I F
- DCS Prefix P..P I..I F data_bytes ST
with these rules/restrictions:
- prefix can only be used with
CSI
andDCS
- only one leading prefix byte is recognized by the parser before any other parameter bytes (P..P)
- intermediate bytes are recognized up to 2
For custom sequences make sure to read ECMA-48 and the resources at vt100.net to not clash with existing sequences or reserved address space. General recommendations:
- use private address space (see ECMA-48)
- use max one intermediate byte (technically not limited by the spec, in practice there are no sequences with more than one intermediate byte, thus parsers might get confused with more intermediates)
- test against other common emulators to check whether they escape/ignore the sequence correctly
Notes:
- OSC command registration is handled differently (see
addOscHandler
). - APC, PM or SOS is currently not supported.
(This is really an interface, but we just go and define our own type that satisfies the interface.)
Fields
prefix: Option<Str>
Optional prefix byte; must be in range \x3c
.. \x3f
.
Usable in CSI
and DCS
.
intermediates: Option<Str>
Optional intermediate bytes; must be in range \x20
.. \x2f
.
Usable in CSI
, DCS
, and ESC
.
final_byte: Str
Final byte; must be in range \x40
.. \x7e
for CSI
and DCS
,
\x30
.. \x7E
for ESC
.
Implementations
impl FunctionIdentifier
[src][−]
pub const fn new(
prefix: Option<Str>,
intermediates: Option<Str>,
final_byte: Str
) -> Self
[src][−]
prefix: Option<Str>,
intermediates: Option<Str>,
final_byte: Str
) -> Self
Constructor.
impl FunctionIdentifier
[−]
pub fn prefix(&self) -> Option<Str>
[src][−]
Optional prefix byte; must be in range \x3c
.. \x3f
.
Usable in CSI
and DCS
.
Getter.
pub fn set_prefix(&mut self, prefix: Option<Str>)
[src][−]
Optional prefix byte; must be in range \x3c
.. \x3f
.
Usable in CSI
and DCS
.
Setter.
pub fn intermediates(&self) -> Option<Str>
[src][−]
Optional intermediate bytes; must be in range \x20
.. \x2f
.
Usable in CSI
, DCS
, and ESC
.
Getter.
pub fn set_intermediates(&mut self, intermediates: Option<Str>)
[src][−]
Optional intermediate bytes; must be in range \x20
.. \x2f
.
Usable in CSI
, DCS
, and ESC
.
Setter.
pub fn final_byte(&self) -> Str
[src][−]
Final byte; must be in range \x40
.. \x7e
for CSI
and DCS
,
\x30
.. \x7E
for ESC
.
Getter.
pub fn set_final_byte(&mut self, final_byte: Str)
[src][−]
Final byte; must be in range \x40
.. \x7e
for CSI
and DCS
,
\x30
.. \x7E
for ESC
.
Setter.
Trait Implementations
impl Clone for FunctionIdentifier
[+]
impl Debug for FunctionIdentifier
[+]
impl From<FunctionIdentifier> for JsValue
[src][+]
impl FromWasmAbi for FunctionIdentifier
[src][+]
impl IntoWasmAbi for FunctionIdentifier
[src][+]
impl OptionFromWasmAbi for FunctionIdentifier
[src][+]
impl OptionIntoWasmAbi for FunctionIdentifier
[src][+]
impl RefFromWasmAbi for FunctionIdentifier
[src][+]
impl RefMutFromWasmAbi for FunctionIdentifier
[src][+]
impl WasmDescribe for FunctionIdentifier
[src][+]
Auto Trait Implementations
impl RefUnwindSafe for FunctionIdentifier
impl Send for FunctionIdentifier
impl Sync for FunctionIdentifier
impl Unpin for FunctionIdentifier
impl UnwindSafe for FunctionIdentifier
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
[src][+]
T: IntoWasmAbi,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,