pub struct File {
pub id: u32,
pub module_id: String,
pub name: String,
pub display_path: String,
pub source_path: Option<PathBuf>,
pub source: String,
pub items: Vec<Expression>,
pub file_comment: Option<String>,
}Fields§
§id: u32§module_id: String§name: StringStable bare filename (e.g. greet.lis); identity key for caching and
LSP path reconstruction.
display_path: StringCwd-relative path for diagnostics and --sourcemap directives; equals
name for synthetic/test loaders that have no notion of cwd.
source_path: Option<PathBuf>Physical source path when it cannot be reconstructed from the module and filename, notably for generated Go typedefs.
source: String§items: Vec<Expression>§file_comment: Option<String>Implementations§
Source§impl File
impl File
pub fn new_cached( module_id: &str, name: &str, display_path: &str, source: &str, id: u32, ) -> Self
pub fn is_d_lis(&self) -> bool
pub fn imports(&self) -> Vec<FileImport>
Sourcepub fn rewrite_import(&mut self, from: &str, to: &str)
pub fn rewrite_import(&mut self, from: &str, to: &str)
Redirects import "{from}" to to, keeping the source spelling as the qualifier.
pub fn go_filename(&self) -> String
Trait Implementations§
impl StructuralPartialEq for File
Auto Trait Implementations§
impl Freeze for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnsafeUnpin for File
impl UnwindSafe for File
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