pub struct Statement<'a> { /* private fields */ }Expand description
One statement out of a script, and where it started.
The text runs from the first token to the last, so it excludes the semicolon and any comment that sat before or after the statement, and it keeps a comment that sat inside one. That is the only split that lets the offset mean anything, and a comment between two tokens is something the parser skips anyway. The offset is kept so that a span coming back from the binder can be moved back into the coordinates of the whole script, which is what a shell needs in order to point at the right line.
Implementations§
Trait Implementations§
impl<'a> Copy for Statement<'a>
impl<'a> Eq for Statement<'a>
impl<'a> StructuralPartialEq for Statement<'a>
Auto Trait Implementations§
impl<'a> Freeze for Statement<'a>
impl<'a> RefUnwindSafe for Statement<'a>
impl<'a> Send for Statement<'a>
impl<'a> Sync for Statement<'a>
impl<'a> Unpin for Statement<'a>
impl<'a> UnsafeUnpin for Statement<'a>
impl<'a> UnwindSafe for Statement<'a>
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