pub struct ParserInput<'a> { /* private fields */ }
Implementations§
Source§impl<'a> ParserInput<'a>
impl<'a> ParserInput<'a>
pub const fn new(str: &'a str, file_id: FileId) -> Self
pub const fn new_with_ctx( str: &'a str, file_id: FileId, ctx: fn() -> Box<dyn Any>, ) -> Self
pub fn ctx(&self) -> Option<fn() -> Box<dyn Any>>
pub const fn inner(&self) -> &str
pub const fn at(&self) -> CodeLocation
pub const fn range(&self, len: usize) -> CodeRange
pub const fn offset(&self) -> usize
pub const fn original(&self) -> &'a str
pub fn apply<T>(&mut self, from: &Span<T>)
pub fn try_eat(&mut self, len: usize) -> Option<Span<&str>>
pub fn try_eat_char(&mut self) -> Option<Span<char>>
pub fn extract(&self, range: CodeRange) -> &str
Trait Implementations§
Source§impl<'a> Clone for ParserInput<'a>
impl<'a> Clone for ParserInput<'a>
Source§fn clone(&self) -> ParserInput<'a>
fn clone(&self) -> ParserInput<'a>
Returns a copy of the value. Read more
1.0.0 · 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 ParserInput<'a>
impl<'a> Debug for ParserInput<'a>
impl<'a> Copy for ParserInput<'a>
Auto Trait Implementations§
impl<'a> Freeze for ParserInput<'a>
impl<'a> RefUnwindSafe for ParserInput<'a>
impl<'a> Send for ParserInput<'a>
impl<'a> Sync for ParserInput<'a>
impl<'a> Unpin for ParserInput<'a>
impl<'a> UnwindSafe for ParserInput<'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