pub struct ChapelModule {
pub name: Option<String>,
pub uses: Vec<String>,
pub requires: Vec<String>,
pub globals: Vec<(String, ChapelType, ChapelExpr)>,
pub configs: Vec<(String, ChapelType, Option<ChapelExpr>)>,
pub procs: Vec<ChapelProc>,
pub records: Vec<ChapelRecord>,
pub classes: Vec<ChapelClass>,
pub submodules: Vec<ChapelModule>,
pub doc: Option<String>,
}Expand description
A Chapel source module (single .chpl file).
Fields§
§name: Option<String>Module name (None = implicit top-level)
uses: Vec<String>use imports
requires: Vec<String>require directives
globals: Vec<(String, ChapelType, ChapelExpr)>Top-level constant declarations
configs: Vec<(String, ChapelType, Option<ChapelExpr>)>Top-level config variable declarations
procs: Vec<ChapelProc>Top-level procedures
records: Vec<ChapelRecord>Top-level record definitions
classes: Vec<ChapelClass>Top-level class definitions
submodules: Vec<ChapelModule>Sub-modules
doc: Option<String>Module-level doc comment
Implementations§
Source§impl ChapelModule
impl ChapelModule
Sourcepub fn add_require(&mut self, path: impl Into<String>)
pub fn add_require(&mut self, path: impl Into<String>)
Add a require directive.
Sourcepub fn add_global(
&mut self,
name: impl Into<String>,
ty: ChapelType,
expr: ChapelExpr,
)
pub fn add_global( &mut self, name: impl Into<String>, ty: ChapelType, expr: ChapelExpr, )
Add a top-level constant.
Sourcepub fn add_config(
&mut self,
name: impl Into<String>,
ty: ChapelType,
default: Option<ChapelExpr>,
)
pub fn add_config( &mut self, name: impl Into<String>, ty: ChapelType, default: Option<ChapelExpr>, )
Add a config variable.
Sourcepub fn add_proc(&mut self, proc: ChapelProc)
pub fn add_proc(&mut self, proc: ChapelProc)
Add a procedure.
Sourcepub fn add_record(&mut self, rec: ChapelRecord)
pub fn add_record(&mut self, rec: ChapelRecord)
Add a record.
Sourcepub fn add_class(&mut self, cls: ChapelClass)
pub fn add_class(&mut self, cls: ChapelClass)
Add a class.
Trait Implementations§
Source§impl Clone for ChapelModule
impl Clone for ChapelModule
Source§fn clone(&self) -> ChapelModule
fn clone(&self) -> ChapelModule
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChapelModule
impl Debug for ChapelModule
Auto Trait Implementations§
impl Freeze for ChapelModule
impl RefUnwindSafe for ChapelModule
impl Send for ChapelModule
impl Sync for ChapelModule
impl Unpin for ChapelModule
impl UnsafeUnpin for ChapelModule
impl UnwindSafe for ChapelModule
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