#[non_exhaustive]pub struct Config {
pub start_line_number: NonZeroU64,
pub source: Option<Rc<Source>>,
}
Expand description
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.start_line_number: NonZeroU64
Line number for the first line of the input
The lexer counts the line number from this value to annotate the
location of the tokens. The line number is saved in the
start_line_number
field of the Code
instance that is contained in
the Location
instance of the token.
The default value is 1.
source: Option<Rc<Source>>
Source of the input
The source is used to annotate the location of the tokens. This value
is saved in the source
field of the Code
instance that is
contained in the Location
instance of the token.
The default value is None
, in which case the source is set to
Source::Unknown
. It is recommended to set this to a more informative
value, so that the locations in the parsed syntax tree can be traced
back to the source code. Especially, the correct source is necessary to
indicate the location of possible errors that occur during parsing and
execution.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl !RefUnwindSafe for Config
impl !Send for Config
impl !Sync for Config
impl Unpin for Config
impl !UnwindSafe for Config
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
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>
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>
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