#[non_exhaustive]pub struct HighlightToken<'a> {
pub kind: HighlightKind,
pub text: &'a str,
pub range: Range<usize>,
}Expand description
A single highlighted token: a classified HighlightKind over a byte range of the source.
#[non_exhaustive] so fields can be added without breaking downstream matches.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: HighlightKindThe highlight classification of this token.
text: &'a strThe token’s exact source text (the slice &input[range]).
range: Range<usize>Byte range of the token in the source.
Trait Implementations§
Source§impl<'a> Clone for HighlightToken<'a>
impl<'a> Clone for HighlightToken<'a>
Source§fn clone(&self) -> HighlightToken<'a>
fn clone(&self) -> HighlightToken<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for HighlightToken<'a>
impl<'a> Debug for HighlightToken<'a>
impl<'a> Eq for HighlightToken<'a>
Source§impl<'a> PartialEq for HighlightToken<'a>
impl<'a> PartialEq for HighlightToken<'a>
impl<'a> StructuralPartialEq for HighlightToken<'a>
Auto Trait Implementations§
impl<'a> Freeze for HighlightToken<'a>
impl<'a> RefUnwindSafe for HighlightToken<'a>
impl<'a> Send for HighlightToken<'a>
impl<'a> Sync for HighlightToken<'a>
impl<'a> Unpin for HighlightToken<'a>
impl<'a> UnsafeUnpin for HighlightToken<'a>
impl<'a> UnwindSafe for HighlightToken<'a>
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