pub struct FileSpan { /* private fields */ }
Expand description
A type representing a single line of a Source
.
Implementations§
Source§impl FileSpan
impl FileSpan
Sourcepub unsafe fn new(start: usize, end: usize, file: FileID) -> Self
pub unsafe fn new(start: usize, end: usize, file: FileID) -> Self
Create a new span with the given start and end offsets, and the given file.
Sourcepub fn get_range(&self) -> Range<usize>
pub fn get_range(&self) -> Range<usize>
Create a new span with the given start and end offsets, and the given file.
Sourcepub fn set_range(&mut self, range: Range<usize>)
pub fn set_range(&mut self, range: Range<usize>)
Create a new span with the given start and end offsets, and the given file.
Sourcepub fn with_range(self, range: Range<usize>) -> Self
pub fn with_range(self, range: Range<usize>) -> Self
Create a new span with the given start and end offsets, and the given file.
Sourcepub fn get_file(&self) -> FileID
pub fn get_file(&self) -> FileID
Create a new span with the given start and end offsets, and the given file.
Trait Implementations§
Source§impl Span for FileSpan
impl Span for FileSpan
Source§type SourceId = FileID
type SourceId = FileID
The identifier used to uniquely refer to a source. In most cases, this is the fully-qualified path of the file.
Source§fn source(&self) -> &Self::SourceId
fn source(&self) -> &Self::SourceId
Get the identifier of the source that this span refers to.
impl Copy for FileSpan
impl Eq for FileSpan
impl StructuralPartialEq for FileSpan
Auto Trait Implementations§
impl Freeze for FileSpan
impl RefUnwindSafe for FileSpan
impl Send for FileSpan
impl Sync for FileSpan
impl Unpin for FileSpan
impl UnwindSafe for FileSpan
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