pub struct SourceRange { /* private fields */ }
Implementations§
Source§impl SourceRange
impl SourceRange
pub fn new(start: usize, end: usize) -> SourceRange
pub fn start(&self) -> usize
pub fn end(&self) -> usize
pub fn at_start(&self) -> SourceRange
pub fn at_end(&self) -> SourceRange
pub fn error( self, typ: SyntaxErrorType, actual_token: Option<TokenType>, ) -> SyntaxError
pub fn add_option(self, rhs: Option<SourceRange>) -> SourceRange
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn extend(&mut self, other: SourceRange)
Trait Implementations§
Source§impl Add for SourceRange
impl Add for SourceRange
Source§impl AddAssign for SourceRange
impl AddAssign for SourceRange
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moreSource§impl Clone for SourceRange
impl Clone for SourceRange
Source§fn clone(&self) -> SourceRange
fn clone(&self) -> SourceRange
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SourceRange
impl Debug for SourceRange
Source§impl<'a> Index<SourceRange> for Lexer<'a>
impl<'a> Index<SourceRange> for Lexer<'a>
impl Copy for SourceRange
Auto Trait Implementations§
impl Freeze for SourceRange
impl RefUnwindSafe for SourceRange
impl Send for SourceRange
impl Sync for SourceRange
impl Unpin for SourceRange
impl UnwindSafe for SourceRange
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