pub struct InputStream { /* private fields */ }Implementations§
Source§impl InputStream
impl InputStream
Sourcepub fn new(input: impl AsRef<str>) -> Self
pub fn new(input: impl AsRef<str>) -> Self
Creates a character stream from UTF-8 text using ANTLR’s unknown source name placeholder.
Trait Implementations§
Source§impl CharStream for InputStream
impl CharStream for InputStream
Source§fn text(&self, interval: TextInterval) -> String
fn text(&self, interval: TextInterval) -> String
Returns text for an inclusive interval of Unicode scalar indices.
Source§fn symbol_at(&self, index: usize) -> Option<i32>
fn symbol_at(&self, index: usize) -> Option<i32>
Reads one Unicode scalar at an absolute character index without moving
the stream cursor. Read more
Source§fn contiguous_ascii(&self) -> Option<&[u8]>
fn contiguous_ascii(&self) -> Option<&[u8]>
Returns the complete input as ASCII bytes when character and byte
indexes are identical.
Source§fn position_summary(&self, start: usize, end: usize) -> Option<PositionSummary>
fn position_summary(&self, start: usize, end: usize) -> Option<PositionSummary>
Summarizes source-position changes for the half-open character interval
[start, end) without moving the stream cursor. Read morefn text_source_interval( &self, interval: TextInterval, ) -> Option<(Rc<str>, usize, usize)>
Source§fn source_text(&self) -> Option<Rc<str>>
fn source_text(&self) -> Option<Rc<str>>
Returns the complete backing UTF-8 source when it can be shared with a
token store. Read more
fn byte_interval(&self, interval: TextInterval) -> Option<(usize, usize)>
Source§impl Clone for InputStream
impl Clone for InputStream
Source§fn clone(&self) -> InputStream
fn clone(&self) -> InputStream
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 moreSource§impl Debug for InputStream
impl Debug for InputStream
Source§impl IntStream for InputStream
impl IntStream for InputStream
Auto Trait Implementations§
impl !Send for InputStream
impl !Sync for InputStream
impl Freeze for InputStream
impl RefUnwindSafe for InputStream
impl Unpin for InputStream
impl UnsafeUnpin for InputStream
impl UnwindSafe for InputStream
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