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 Items.

Implementations§

source§

impl Package

source

pub fn from(ast: &Package) -> Result<Package, Vec<BitsyError>>

source

pub fn idents(&self) -> Vec<Ident>

source

pub fn top(&self, top_name: &str) -> Result<Circuit, BitsyError>

source

pub fn items(&self) -> Vec<Item>

source

pub fn item(&self, name: &str) -> Option<Item>

source

pub fn moddefs(&self) -> Vec<Arc<Component>>

source

pub fn moddef(&self, name: &str) -> Option<Arc<Component>>

source

pub fn extdef(&self, name: &str) -> Option<Arc<Component>>

source

pub fn typedef(&self, name: &str) -> Option<Arc<EnumTypeDef>>

source

pub fn fndef(&self, name: &str) -> Option<Arc<FnDef>>

source

pub fn fndefs(&self) -> Vec<Arc<FnDef>>

source

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.

source

pub fn type_of(&self, component: Arc<Component>) -> Option<Type>

source§

impl Package

source

pub fn emit_mlir(&self)

Trait Implementations§

source§

impl Clone for Package

source§

fn clone(&self) -> Package

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Package

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.