pub struct Span {
pub start: usize,
pub end: usize,
}Expand description
Byte span of an AST node.
[start, end) into the original source, same basis as Token::start/
Token::end. Covers every (non-virtual) token that belongs to the node —
first token’s start to last token’s end.
Invariants the parser maintains (checked over the corpus by
render_from_ast): a child’s span is contained in its parent’s span, and
sibling spans are ordered and non-overlapping. Trivia (comments, blank
lines) live between sibling spans.
Fields§
§start: usize§end: usizeImplementations§
Trait Implementations§
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 UnsafeUnpin 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