pub struct NamespaceDef {
pub imports: Vec<PosString>,
pub components: Vec<ComponentDef>,
pub externs: Vec<(Option<PosString>, Vec<Primitive>)>,
pub metadata: Option<String>,
pub source_info_table: Option<SourceInfoTable>,
}
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.
source_info_table: Option<SourceInfoTable>
Optional Source Info table
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 Freeze for NamespaceDef
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more