Struct bitsy_lang::Package
source · pub struct Package { /* private fields */ }
Expand description
A Package is a parsed Bitsy file.
It consists of a number of top-level Item
s.
Implementations§
source§impl Package
impl Package
pub fn from(ast: &Package) -> Result<Package, Vec<BitsyError>>
pub fn idents(&self) -> Vec<Ident>
pub fn top(&self, top_name: &str) -> Result<Circuit, BitsyError>
pub fn items(&self) -> Vec<Item>
pub fn item(&self, name: &str) -> Option<Item>
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 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