#[non_exhaustive]pub struct Context { /* private fields */ }Expand description
Parameter passed to the input function
The context is passed to the input function so that it can read the input in a context-dependent way.
Implementations§
Source§impl Context
impl Context
Sourcepub fn is_first_line(&self) -> bool
pub fn is_first_line(&self) -> bool
Whether the current line is the first line of the input
Sourcepub fn set_is_first_line(&mut self, is_first_line: bool)
pub fn set_is_first_line(&mut self, is_first_line: bool)
Sets whether the current line is the first line of the input
This method is used by the lexer to set the flag. It can also be used in
tests to simulate a non-first line. The default value is true.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more