pub struct Token {
pub start_utf16: u32,
pub end_utf16: u32,
pub kind: &'static str,
}Expand description
A highlighted range within the source, ready to cross the WASM
boundary. Offsets are UTF-16 code units to match the
convention used everywhere else in this codebase
(TextSpan, selection, utf16_len) — the JS side does
string.slice(token.start, token.end) directly with these
numbers.
Fields§
§start_utf16: u32UTF-16 code-unit offset where the token starts (inclusive).
end_utf16: u32UTF-16 code-unit offset where the token ends (exclusive).
kind: &'static strShort kebab-case kind, see TokenKind::as_str.
Trait Implementations§
impl Eq for Token
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnsafeUnpin for Token
impl UnwindSafe for Token
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more