pub struct SrcPos {
pub source: Source,
/* private fields */
}
Expand description
Lexical position in a file.
Fields§
§source: Source
The source
Implementations§
Source§impl SrcPos
impl SrcPos
pub fn new(source: Source, range: Range) -> SrcPos
Sourcepub fn code_context(&self) -> String
pub fn code_context(&self) -> String
Create a string for pretty printing
pub fn show(&self, message: &str) -> String
Sourcepub fn combine_into(self, other: &dyn AsRef<Self>) -> Self
pub fn combine_into(self, other: &dyn AsRef<Self>) -> Self
Combines two lexical positions into a larger legical position overlapping both The file name is assumed to be the same
pub fn start(&self) -> Position
pub fn end(&self) -> Position
pub fn range(&self) -> Range
pub fn file_name(&self) -> &Path
pub fn combine(&self, other: &dyn AsRef<Self>) -> Self
Trait Implementations§
impl Eq for SrcPos
impl StructuralPartialEq for SrcPos
Auto Trait Implementations§
impl Freeze for SrcPos
impl !RefUnwindSafe for SrcPos
impl Send for SrcPos
impl Sync for SrcPos
impl Unpin for SrcPos
impl !UnwindSafe for SrcPos
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