pub struct AtomStream { /* private fields */ }Expand description
A parse source over an eagerly lexed token vector.
Backtracking runs through syan’s Tape, which owns the pushback and the
checkpoint scopes, so this is a thin forwarding shim and nothing more.
Implementations§
Trait Implementations§
Source§impl ParseStream for AtomStream
impl ParseStream for AtomStream
Source§type Error = Infallible
type Error = Infallible
What the underlying source reports when it fails; see
get_error.Source§fn next(&mut self) -> Option<Self::Atom>
fn next(&mut self) -> Option<Self::Atom>
Consume and return the next atom, or
None at end of input.Source§fn push(&mut self, atom: Self::Atom)
fn push(&mut self, atom: Self::Atom)
Hand an atom back; it is served before anything still unread.
Source§fn checkpoint_raw(&mut self) -> u64
fn checkpoint_raw(&mut self) -> u64
Open a transaction; the returned token identifies it. Read more
Source§fn rollback_raw(&mut self, raw: u64)
fn rollback_raw(&mut self, raw: u64)
Undo everything consumed since
raw was taken, and close that scope.Source§fn commit_raw(&mut self, raw: u64)
fn commit_raw(&mut self, raw: u64)
Keep everything consumed since
raw was taken, and close that scope.Source§fn get_error(&mut self) -> Result<(), Self::Error>
fn get_error(&mut self) -> Result<(), Self::Error>
Report an error the source has accumulated (a lexer that failed mid-stream, say), as opposed
to a parse failure.
Ok(()) for a source that cannot fail.Source§fn skip_sep(&mut self) -> bool
fn skip_sep(&mut self) -> bool
Skip the separator atoms if exists. Returns whether we skipped some separators. Read more
Source§fn validate_spacing<S>(&mut self, is_joint: bool) -> Result<(), ParseError<S>>
fn validate_spacing<S>(&mut self, is_joint: bool) -> Result<(), ParseError<S>>
Check the spacing before the next atom:
is_joint demands no separator here, false demands
one. Fails with ParseError::Spacing if the input
disagrees.Auto Trait Implementations§
impl Freeze for AtomStream
impl RefUnwindSafe for AtomStream
impl Send for AtomStream
impl Sync for AtomStream
impl Unpin for AtomStream
impl UnsafeUnpin for AtomStream
impl UnwindSafe for AtomStream
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> IntoParseStream for Twhere
T: ParseStream,
impl<T> IntoParseStream for Twhere
T: ParseStream,
Source§type Atom = <T as ParseStream>::Atom
type Atom = <T as ParseStream>::Atom
The unit of input the resulting stream serves.
Source§fn into_parse_stream(self) -> <T as IntoParseStream>::Output
fn into_parse_stream(self) -> <T as IntoParseStream>::Output
Build the stream.