pub struct SourceMap { /* private fields */ }Implementations§
Source§impl SourceMap
impl SourceMap
pub fn new(source: impl Into<Arc<str>>) -> Self
pub fn source(&self) -> &str
pub fn source_arc(&self) -> Arc<str>
pub fn source_len(&self) -> usize
pub fn line_starts(&self) -> &[usize]
pub fn line_col(&self, offset: usize) -> Result<LineCol, SourceMapError>
pub fn utf16_position( &self, offset: usize, ) -> Result<Utf16Position, SourceMapError>
pub fn span( &self, start: usize, end: usize, ) -> Result<DiagnosticSpan, SourceMapError>
pub fn whole_source_span(&self) -> Result<DiagnosticSpan, SourceMapError>
pub fn line_bounds(&self, line_index: usize) -> Option<(usize, usize)>
pub fn byte_offset_for_utf16_position( &self, position: Utf16Position, ) -> Option<usize>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SourceMap
impl RefUnwindSafe for SourceMap
impl Send for SourceMap
impl Sync for SourceMap
impl Unpin for SourceMap
impl UnsafeUnpin for SourceMap
impl UnwindSafe for SourceMap
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