#[repr(C)]pub struct Span {
pub file_id: u32,
pub start_line: u32,
pub start_col: u32,
pub end_line: u32,
pub end_col: u32,
}Expand description
Source location span: file ID and line:column ranges (1-based, inclusive start, exclusive end).
Fields§
§file_id: u32§start_line: u32§start_col: u32§end_line: u32§end_col: u32Implementations§
Source§impl Span
impl Span
pub fn new( file_id: u32, start_line: u32, start_col: u32, end_line: u32, end_col: u32, ) -> Self
pub fn to_le(self) -> Self
pub fn from_le(self) -> Self
pub fn file_id(&self) -> u32
pub fn start_line(&self) -> u32
pub fn start_col(&self) -> u32
pub fn end_line(&self) -> u32
pub fn end_col(&self) -> u32
Sourcepub fn contains(&self, file_id: u32, line: u32, col: u32) -> bool
pub fn contains(&self, file_id: u32, line: u32, col: u32) -> bool
Returns true if this span contains the given (line, col) position in the specified file.
Sourcepub fn approximate_size(&self) -> u64
pub fn approximate_size(&self) -> u64
Approximate character length metric used for picking the innermost span when nested.
Trait Implementations§
impl Copy for Span
impl Eq for Span
impl StructuralPartialEq for Span
Auto Trait Implementations§
impl Forget for Span
impl Freeze for Span
impl Move 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