Struct calyx_frontend::ast::NamespaceDef
source · pub struct NamespaceDef {
pub imports: Vec<String>,
pub components: Vec<ComponentDef>,
pub externs: Vec<(Option<String>, Vec<Primitive>)>,
pub metadata: Option<String>,
}
Expand description
Corresponds to an individual Calyx file.
Fields§
§imports: Vec<String>
Path to extern files.
components: Vec<ComponentDef>
List of component definitions.
externs: Vec<(Option<String>, Vec<Primitive>)>
Extern statements and any primitive declarations in them.
metadata: Option<String>
Optional opaque metadata
Implementations§
source§impl NamespaceDef
impl NamespaceDef
sourcepub fn construct(file: &Option<PathBuf>) -> CalyxResult<Self>
pub fn construct(file: &Option<PathBuf>) -> CalyxResult<Self>
Construct a namespace from a file or the input stream. If no file is provided, the input stream must be a TTY.
sourcepub fn construct_from_str(inp: &str) -> CalyxResult<Self>
pub fn construct_from_str(inp: &str) -> CalyxResult<Self>
Construct a namespace from a definition using a string.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for NamespaceDef
impl Send for NamespaceDef
impl Sync for NamespaceDef
impl Unpin for NamespaceDef
impl UnwindSafe for NamespaceDef
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