pub struct MatlabFile {
pub functions: Vec<MatlabFunction>,
pub scripts: Vec<MatlabStmt>,
pub classdef: Option<MatlabClassdef>,
pub header_comment: Option<String>,
pub is_script: bool,
}Expand description
Top-level MATLAB file structure.
Fields§
§functions: Vec<MatlabFunction>Top-level functions (first is the main function)
scripts: Vec<MatlabStmt>Script statements (for script files — no functions)
classdef: Option<MatlabClassdef>Class definition (for classdef files)
header_comment: Option<String>File-level comment block
is_script: boolWhether this is a script file (no function wrapper)
Implementations§
Source§impl MatlabFile
impl MatlabFile
pub fn new() -> Self
pub fn script() -> Self
pub fn add_function(&mut self, fun: MatlabFunction)
pub fn add_script_stmt(&mut self, stmt: MatlabStmt)
pub fn with_classdef(self, cls: MatlabClassdef) -> Self
pub fn with_header(self, comment: &str) -> Self
Trait Implementations§
Source§impl Clone for MatlabFile
impl Clone for MatlabFile
Source§fn clone(&self) -> MatlabFile
fn clone(&self) -> MatlabFile
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 MatlabFile
impl Debug for MatlabFile
Auto Trait Implementations§
impl Freeze for MatlabFile
impl RefUnwindSafe for MatlabFile
impl Send for MatlabFile
impl Sync for MatlabFile
impl Unpin for MatlabFile
impl UnsafeUnpin for MatlabFile
impl UnwindSafe for MatlabFile
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