Struct lang_util::position::LexerPosition
source · [−]Expand description
A position in the lexer’s input
Fields
source_id: FileIdSource id
offset: TextSizeRaw byte offset
Implementations
sourceimpl LexerPosition
impl LexerPosition
sourcepub fn new_raw<E: Debug>(
source_id: FileId,
offset: impl TryInto<u32, Error = E>
) -> Self
pub fn new_raw<E: Debug>(
source_id: FileId,
offset: impl TryInto<u32, Error = E>
) -> Self
Create a new LexerPosition
Parameters
source_id: source idoffset: raw byte offset in the input
Panics
Panics if the offset can’t be converted to a u32.
Trait Implementations
sourceimpl Clone for LexerPosition
impl Clone for LexerPosition
sourcefn clone(&self) -> LexerPosition
fn clone(&self) -> LexerPosition
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for LexerPosition
impl Debug for LexerPosition
sourceimpl Default for LexerPosition
impl Default for LexerPosition
sourcefn default() -> LexerPosition
fn default() -> LexerPosition
Returns the “default value” for a type. Read more
sourceimpl Display for LexerPosition
impl Display for LexerPosition
sourceimpl From<LexerPosition> for FileId
impl From<LexerPosition> for FileId
sourcefn from(value: LexerPosition) -> Self
fn from(value: LexerPosition) -> Self
Converts to this type from the input type.
sourceimpl From<LexerPosition> for TextSize
impl From<LexerPosition> for TextSize
sourcefn from(value: LexerPosition) -> Self
fn from(value: LexerPosition) -> Self
Converts to this type from the input type.
sourceimpl Hash for LexerPosition
impl Hash for LexerPosition
sourceimpl Ord for LexerPosition
impl Ord for LexerPosition
sourcefn cmp(&self, other: &LexerPosition) -> Ordering
fn cmp(&self, other: &LexerPosition) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<LexerPosition> for LexerPosition
impl PartialEq<LexerPosition> for LexerPosition
sourcefn eq(&self, other: &LexerPosition) -> bool
fn eq(&self, other: &LexerPosition) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourceimpl PartialOrd<LexerPosition> for LexerPosition
impl PartialOrd<LexerPosition> for LexerPosition
sourcefn partial_cmp(&self, other: &LexerPosition) -> Option<Ordering>
fn partial_cmp(&self, other: &LexerPosition) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Copy for LexerPosition
impl Eq for LexerPosition
impl StructuralEq for LexerPosition
impl StructuralPartialEq for LexerPosition
Auto Trait Implementations
impl RefUnwindSafe for LexerPosition
impl Send for LexerPosition
impl Sync for LexerPosition
impl Unpin for LexerPosition
impl UnwindSafe for LexerPosition
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more