pub struct SourceFile {
pub path: String,
/* private fields */
}Expand description
One source file in the program’s file registry.
Fields§
§path: StringThe file name as the frontend reported it (for diagnostics).
Implementations§
Source§impl SourceFile
impl SourceFile
Sourcepub fn with_source(path: impl Into<String>, source: impl Into<String>) -> Self
pub fn with_source(path: impl Into<String>, source: impl Into<String>) -> Self
Create a file entry that retains its authored source text and comments.
Sourcepub fn set_source(&mut self, source: impl Into<String>)
pub fn set_source(&mut self, source: impl Into<String>)
Attach authored source to an existing file entry.
Sourcepub fn source(&self) -> Option<&SourceDocument>
pub fn source(&self) -> Option<&SourceDocument>
The retained authored source, when this file was created source-aware.
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 moreSource§impl Debug for SourceFile
impl Debug for SourceFile
impl Eq for SourceFile
Source§impl PartialEq for SourceFile
impl PartialEq for SourceFile
impl StructuralPartialEq for SourceFile
Auto 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