pub struct SyntaxToken {
pub range: Range<usize>,
pub kind: SyntaxKind,
}Expand description
Syntax token emitted by code highlighters.
The half-open range uses UTF-8 byte offsets into the exact source passed to the highlighter.
§Examples
use ailloli_ui_editor::code::{SyntaxKind, SyntaxToken};
let token = SyntaxToken { range: 0..2, kind: SyntaxKind::Keyword };
assert_eq!(token.range, 0..2);Fields§
§range: Range<usize>Half-open UTF-8 source byte range.
kind: SyntaxKindLanguage-neutral semantic paint category.
Trait Implementations§
Source§impl Clone for SyntaxToken
impl Clone for SyntaxToken
Source§fn clone(&self) -> SyntaxToken
fn clone(&self) -> SyntaxToken
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SyntaxToken
impl Debug for SyntaxToken
Source§impl<'de> Deserialize<'de> for SyntaxToken
impl<'de> Deserialize<'de> for SyntaxToken
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SyntaxToken
impl PartialEq for SyntaxToken
Source§impl Serialize for SyntaxToken
impl Serialize for SyntaxToken
impl Eq for SyntaxToken
impl StructuralPartialEq for SyntaxToken
Auto Trait Implementations§
impl Freeze for SyntaxToken
impl RefUnwindSafe for SyntaxToken
impl Send for SyntaxToken
impl Sync for SyntaxToken
impl Unpin for SyntaxToken
impl UnwindSafe for SyntaxToken
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.