pub struct MatlabModuleBuilder {
pub name: String,
pub functions: Vec<MatlabFunction>,
pub classes: Vec<MatlabClassdef>,
pub scripts: Vec<MatlabScript>,
pub globals: Vec<String>,
pub config: MatlabGenConfig,
}Expand description
A high-level builder for MATLAB modules (collections of functions).
Fields§
§name: StringModule name.
functions: Vec<MatlabFunction>Functions in declaration order.
classes: Vec<MatlabClassdef>Classes in declaration order.
scripts: Vec<MatlabScript>Scripts (stand-alone statements).
globals: Vec<String>Global variable declarations.
config: MatlabGenConfigConfiguration.
Implementations§
Source§impl MatlabModuleBuilder
impl MatlabModuleBuilder
Sourcepub fn add_function(self, func: MatlabFunction) -> Self
pub fn add_function(self, func: MatlabFunction) -> Self
Add a function.
Sourcepub fn add_class(self, cls: MatlabClassdef) -> Self
pub fn add_class(self, cls: MatlabClassdef) -> Self
Add a class.
Sourcepub fn add_script(self, script: MatlabScript) -> Self
pub fn add_script(self, script: MatlabScript) -> Self
Add a script.
Sourcepub fn declare_global(self, name: impl Into<String>) -> Self
pub fn declare_global(self, name: impl Into<String>) -> Self
Declare a global variable.
Sourcepub fn total_items(&self) -> usize
pub fn total_items(&self) -> usize
Number of items in the module.
Auto Trait Implementations§
impl Freeze for MatlabModuleBuilder
impl RefUnwindSafe for MatlabModuleBuilder
impl Send for MatlabModuleBuilder
impl Sync for MatlabModuleBuilder
impl Unpin for MatlabModuleBuilder
impl UnsafeUnpin for MatlabModuleBuilder
impl UnwindSafe for MatlabModuleBuilder
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