Struct calyx_frontend::ast::NamespaceDef
source · [−]pub struct NamespaceDef {
pub imports: Vec<PosString>,
pub components: Vec<ComponentDef>,
pub externs: Vec<(Option<PosString>, Vec<Primitive>)>,
pub metadata: Option<String>,
}
Expand description
Corresponds to an individual Calyx file.
Fields
imports: Vec<PosString>
Path to extern files.
components: Vec<ComponentDef>
List of component definitions.
externs: Vec<(Option<PosString>, Vec<Primitive>)>
Extern statements and any primitive declarations in them.
metadata: Option<String>
Optional opaque metadata
Implementations
sourceimpl 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more