pub struct Span {
pub line: usize,
pub col: usize,
pub end_line: usize,
pub end_col: usize,
}Fields§
§line: usize§col: usize§end_line: usize§end_col: usizeImplementations§
Source§impl Span
impl Span
Sourcepub fn new(line: usize, col: usize, end_line: usize, end_col: usize) -> Self
pub fn new(line: usize, col: usize, end_line: usize, end_col: usize) -> Self
Create a span with explicit start and end.
Sourcepub fn to(self, other: &Span) -> Span
pub fn to(self, other: &Span) -> Span
Create a span from the start of self to the end of other.
Sourcepub fn with_end(self, end_line: usize, end_col: usize) -> Span
pub fn with_end(self, end_line: usize, end_col: usize) -> Span
Create a span from the start of self to an explicit end position.
Sourcepub fn contains(&self, other: &Span) -> bool
pub fn contains(&self, other: &Span) -> bool
Check if self fully contains other (inclusive bounds).
Sourcepub fn contains_pos(&self, line: usize, col: usize) -> bool
pub fn contains_pos(&self, line: usize, col: usize) -> bool
Check if position (line, col) falls within this span (inclusive).
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.