[−]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]
#[must_use]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
#[must_use]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.
#[must_use]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.
#[must_use]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
fn clone(&self) -> FunctionIdentifier
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for FunctionIdentifier
impl From<FunctionIdentifier> for JsValue
[src]
fn from(value: FunctionIdentifier) -> Self
[src]
impl FromWasmAbi for FunctionIdentifier
[src]
type Abi = u32
The wasm ABI type that this converts from when coming back out from the ABI boundary. Read more
unsafe fn from_abi(js: u32) -> Self
[src]
impl IntoWasmAbi for FunctionIdentifier
[src]
type Abi = u32
The wasm ABI type that this converts into when crossing the ABI boundary. Read more
fn into_abi(self) -> u32
[src]
impl OptionFromWasmAbi for FunctionIdentifier
[src]
impl OptionIntoWasmAbi for FunctionIdentifier
[src]
impl RefFromWasmAbi for FunctionIdentifier
[src]
type Abi = u32
The wasm ABI type references to Self
are recovered from.
type Anchor = Ref<'static, FunctionIdentifier>
The type that holds the reference to Self
for the duration of the invocation of the function that has an &Self
parameter. This is required to ensure that the lifetimes don't persist beyond one function call, and so that they remain anonymous. Read more
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
[src]
impl RefMutFromWasmAbi for FunctionIdentifier
[src]
type Abi = u32
Same as RefFromWasmAbi::Abi
type Anchor = RefMut<'static, FunctionIdentifier>
Same as RefFromWasmAbi::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
[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,
fn borrow_mut(&mut self) -> &mut T
[src]
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,
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,