pub struct Packages {
pub books: IndexMap<Name, RefCell<ParseBook>>,
pub loaded_adts: IndexMap<Name, IndexMap<Name, Vec<Name>>>,
/* private fields */
}
Fields§
§books: IndexMap<Name, RefCell<ParseBook>>
Map from source name to parsed book.
loaded_adts: IndexMap<Name, IndexMap<Name, Vec<Name>>>
Already loaded ADTs information to be used when applying ADT binds. Source path -> ADT names -> constructor names.
Implementations§
Source§impl Packages
impl Packages
pub fn new(book: ParseBook) -> Self
Sourcepub fn load_imports(
&mut self,
loader: &mut impl PackageLoader,
diag: &mut Diagnostics,
) -> Result<ParseBook, Diagnostics>
pub fn load_imports( &mut self, loader: &mut impl PackageLoader, diag: &mut Diagnostics, ) -> Result<ParseBook, Diagnostics>
Loads each import statement recursively into a Source -> ParseBook map. Inserts into the ImportsMap of each book all the imported names.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Packages
impl !RefUnwindSafe for Packages
impl Send for Packages
impl !Sync for Packages
impl Unpin for Packages
impl UnwindSafe for Packages
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more