pub struct Span {
pub start: Position,
pub end: Position,
}
Expand description
Area that an object spans inside a file.
The area cannot be empty.
[pest::Span<'i>
] forces us to track lifetimes, so we introduce our own struct.
Fields§
§start: Position
Position where the object starts, inclusively.
end: Position
Position where the object ends, inclusively.
Implementations§
Trait Implementations§
Source§impl AsRef<Span> for Assignment
impl AsRef<Span> for Assignment
Source§impl AsRef<Span> for Assignment
impl AsRef<Span> for Assignment
Source§impl AsRef<Span> for Expression
impl AsRef<Span> for Expression
Source§impl AsRef<Span> for Expression
impl AsRef<Span> for Expression
Source§impl AsRef<Span> for ModuleAssignment
impl AsRef<Span> for ModuleAssignment
Source§impl AsRef<Span> for ModuleAssignment
impl AsRef<Span> for ModuleAssignment
Source§impl AsRef<Span> for ModuleProgram
impl AsRef<Span> for ModuleProgram
Source§impl AsRef<Span> for SingleExpression
impl AsRef<Span> for SingleExpression
Source§impl AsRef<Span> for SingleExpression
impl AsRef<Span> for SingleExpression
impl Copy for Span
impl Eq for Span
impl StructuralPartialEq for Span
Auto Trait Implementations§
impl Freeze for Span
impl RefUnwindSafe for Span
impl Send for Span
impl Sync for Span
impl Unpin for Span
impl UnwindSafe for Span
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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