pub struct Package { /* private fields */ }Expand description
A Package is a parsed Bitsy file.
It consists of a number of top-level Items.
Implementations§
Source§impl Package
impl Package
pub fn from(ast: &Package) -> Result<Package, Vec<BitsyError>>
pub fn top(&self, top_name: &str) -> Result<Circuit, BitsyError>
pub fn moddefs(&self) -> Vec<Arc<Component>>
pub fn moddef(&self, name: &str) -> Option<Arc<Component>>
pub fn extdef(&self, name: &str) -> Option<Arc<Component>>
pub fn typedef(&self, name: &str) -> Option<Arc<EnumTypeDef>>
pub fn fndef(&self, name: &str) -> Option<Arc<FnDef>>
pub fn fndefs(&self) -> Vec<Arc<FnDef>>
Sourcepub fn context_for(&self, component: Arc<Component>) -> Context<Path, Type>
pub fn context_for(&self, component: Arc<Component>) -> Context<Path, Type>
Look at all components in scope, work out their type, and build a context::Context to assist in typechecking.
pub fn type_of(&self, component: Arc<Component>) -> Option<Type>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Package
impl RefUnwindSafe for Package
impl Send for Package
impl Sync for Package
impl Unpin for Package
impl UnwindSafe for Package
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