pub enum LoadedCst {
V0_0(File),
V0_1(FileV1),
}Expand description
A parsed file’s CST, tagged by which grammar generation produced it.
load() picks the variant per file, from that file’s own
LoadedFile::version — which a cross-version Legacy load can vary
WITHIN one program (see that field). The enum exists so LoadedFile has a
single field type rather than forcing every consumer of LoadedProgram to
be generic over the CST type.
Variants§
Implementations§
Source§impl LoadedCst
impl LoadedCst
Sourcepub fn is_document(&self) -> bool
pub fn is_document(&self) -> bool
Whether this file is a document (has a body) rather than a library.
Used by load()’s entry/dependency-shape validation
(DocumentAsDependency/LibraryAsEntry) uniformly across both
generations, so that validation logic itself needs no match at its
call sites.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LoadedCst
impl RefUnwindSafe for LoadedCst
impl Send for LoadedCst
impl Sync for LoadedCst
impl Unpin for LoadedCst
impl UnsafeUnpin for LoadedCst
impl UnwindSafe for LoadedCst
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