pub struct LexicalSpan { /* private fields */ }Implementations§
Source§impl LexicalSpan
impl LexicalSpan
pub fn zeros() -> LexicalSpan
pub fn new(start: usize, end: usize) -> LexicalSpan
pub fn start(&self) -> usize
pub fn end(&self) -> usize
pub fn combine(self, other: LexicalSpan) -> LexicalSpan
pub fn slice<'a>(&'a self, item: &'a str) -> &'a str
pub fn find_row_and_column( &self, source_text: impl AsRef<str>, ) -> (usize, usize)
Trait Implementations§
Source§impl Clone for LexicalSpan
impl Clone for LexicalSpan
Source§fn clone(&self) -> LexicalSpan
fn clone(&self) -> LexicalSpan
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 moreimpl Copy for LexicalSpan
Source§impl Debug for LexicalSpan
impl Debug for LexicalSpan
Source§impl Display for LexicalSpan
impl Display for LexicalSpan
impl Eq for LexicalSpan
Source§impl Hash for LexicalSpan
impl Hash for LexicalSpan
Source§impl IntoIterator for LexicalSpan
impl IntoIterator for LexicalSpan
Source§impl Ord for LexicalSpan
impl Ord for LexicalSpan
Source§fn cmp(&self, other: &LexicalSpan) -> Ordering
fn cmp(&self, other: &LexicalSpan) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for LexicalSpan
impl PartialEq for LexicalSpan
Source§impl PartialOrd for LexicalSpan
impl PartialOrd for LexicalSpan
impl StructuralPartialEq for LexicalSpan
Auto Trait Implementations§
impl Freeze for LexicalSpan
impl RefUnwindSafe for LexicalSpan
impl Send for LexicalSpan
impl Sync for LexicalSpan
impl Unpin for LexicalSpan
impl UnsafeUnpin for LexicalSpan
impl UnwindSafe for LexicalSpan
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,
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