pub struct SourceView<'a> { /* private fields */ }Implementations§
Source§impl<'a> SourceView<'a>
impl<'a> SourceView<'a>
pub fn new(text: &'a str, source_map: &'a SourceMap) -> Self
pub fn text(self) -> &'a str
pub fn source_map(self) -> &'a SourceMap
pub fn display_range(self, range: TextRange) -> Range<usize>
pub fn display_slice(self, range: TextRange) -> &'a str
pub fn slice(self, range: TextRange) -> &'a str
pub fn source_range_from_display_range(self, range: Range<usize>) -> TextRange
Trait Implementations§
Source§impl<'a> Clone for SourceView<'a>
impl<'a> Clone for SourceView<'a>
Source§fn clone(&self) -> SourceView<'a>
fn clone(&self) -> SourceView<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for SourceView<'a>
impl<'a> Debug for SourceView<'a>
impl<'a> Copy for SourceView<'a>
Auto Trait Implementations§
impl<'a> Freeze for SourceView<'a>
impl<'a> RefUnwindSafe for SourceView<'a>
impl<'a> Send for SourceView<'a>
impl<'a> Sync for SourceView<'a>
impl<'a> Unpin for SourceView<'a>
impl<'a> UnsafeUnpin for SourceView<'a>
impl<'a> UnwindSafe for SourceView<'a>
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