pub struct SourceFile { /* private fields */ }Implementations§
Source§impl SourceFile
impl SourceFile
pub fn name(&self) -> &str
pub fn text(&self) -> &str
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Whether this snapshot covers the entire decoded resource. An include
may retain an intact prefix or omit skipped undecodable lines. Ranges
address text; omitted_lines describes gaps and position maps them
to original physical line numbers.
Sourcepub fn omitted_lines(&self) -> &[OmittedSourceLine]
pub fn omitted_lines(&self) -> &[OmittedSourceLine]
Undecodable physical lines omitted from text, retaining their exact
bytes and insertion points. Spans address retained UTF-8 snapshot text.
Sourcepub fn omitted_slice(&self, span: OmittedSourceSpan) -> Option<&[u8]>
pub fn omitted_slice(&self, span: OmittedSourceSpan) -> Option<&[u8]>
Resolve a diagnostic’s raw byte range in an omitted physical line.
pub fn position(&self, offset: usize) -> Option<SourcePosition>
Trait Implementations§
Source§impl Clone for SourceFile
impl Clone for SourceFile
Source§fn clone(&self) -> SourceFile
fn clone(&self) -> SourceFile
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SourceFile
impl RefUnwindSafe for SourceFile
impl Send for SourceFile
impl Sync for SourceFile
impl Unpin for SourceFile
impl UnsafeUnpin for SourceFile
impl UnwindSafe for SourceFile
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