Struct ide_db::syntax_helpers::LexedStr
pub struct LexedStr<'a> { /* private fields */ }
Implementations§
§impl<'a> LexedStr<'a>
impl<'a> LexedStr<'a>
pub fn new(edition: Edition, text: &'a str) -> LexedStr<'a>
pub fn single_token( edition: Edition, text: &'a str, ) -> Option<(SyntaxKind, Option<String>)>
pub fn as_str(&self) -> &str
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn kind(&self, i: usize) -> SyntaxKind
pub fn text(&self, i: usize) -> &str
pub fn range_text(&self, r: Range<usize>) -> &str
pub fn text_range(&self, i: usize) -> Range<usize>
pub fn text_start(&self, i: usize) -> usize
pub fn text_len(&self, i: usize) -> usize
pub fn error(&self, i: usize) -> Option<&str>
pub fn errors(&self) -> impl Iterator<Item = (usize, &str)>
Auto Trait Implementations§
impl<'a> Freeze for LexedStr<'a>
impl<'a> RefUnwindSafe for LexedStr<'a>
impl<'a> Send for LexedStr<'a>
impl<'a> Sync for LexedStr<'a>
impl<'a> Unpin for LexedStr<'a>
impl<'a> UnwindSafe for LexedStr<'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
§impl<T> Cast for T
impl<T> Cast for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more