pub struct Range {
pub start: Pos,
pub end: Pos,
pub ctx: SyntaxCtxIndex,
}Expand description
Describes a position in a source code (syntax context). It’s useful to generate error messages.
Fields§
§start: Pos§end: Pos§ctx: SyntaxCtxIndexImplementations§
Source§impl Range
impl Range
pub fn new(start: Pos, end: Pos, ctx: SyntaxCtxIndex) -> Range
pub fn ghost_range() -> Range
Sourcepub fn mix(&self, next: Range) -> Range
pub fn mix(&self, next: Range) -> Range
Joins two ranges. It keeps the syntax context of the first one.
Sourcepub fn set_ctx(&self, ctx: SyntaxCtxIndex) -> Range
pub fn set_ctx(&self, ctx: SyntaxCtxIndex) -> Range
Sets the context of the range,
pub fn encode(&self) -> EncodedRange
Trait Implementations§
impl Copy for Range
impl Eq for Range
impl StructuralPartialEq for Range
Auto Trait Implementations§
impl Freeze for Range
impl RefUnwindSafe for Range
impl Send for Range
impl Sync for Range
impl Unpin for Range
impl UnwindSafe for Range
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