pub enum MatlabExpr {
Show 16 variants
Lit(MatlabLiteral),
Var(String),
MatrixLit(Vec<Vec<MatlabExpr>>),
CellLit(Vec<Vec<MatlabExpr>>),
ColonRange {
start: Box<MatlabExpr>,
step: Option<Box<MatlabExpr>>,
end: Box<MatlabExpr>,
},
Call(Box<MatlabExpr>, Vec<MatlabExpr>),
Index {
obj: Box<MatlabExpr>,
indices: Vec<MatlabExpr>,
cell_index: bool,
},
FieldAccess(Box<MatlabExpr>, String),
BinaryOp(String, Box<MatlabExpr>, Box<MatlabExpr>),
UnaryOp(String, Box<MatlabExpr>, bool),
IfExpr(Box<MatlabExpr>, Box<MatlabExpr>, Box<MatlabExpr>),
AnonFunc(Vec<String>, Box<MatlabExpr>),
End,
Colon,
Nargin,
Nargout,
}Expand description
MATLAB expression.
Variants§
Lit(MatlabLiteral)
Literal value
Var(String)
Variable reference: x
MatrixLit(Vec<Vec<MatlabExpr>>)
Matrix literal: [1 2; 3 4]
CellLit(Vec<Vec<MatlabExpr>>)
Cell array literal: {1, 'a', true}
ColonRange
Colon range: start:step:end or start:end
Call(Box<MatlabExpr>, Vec<MatlabExpr>)
Function call: f(a, b)
Index
Indexing: A(i, j) or A{i} (cell)
FieldAccess(Box<MatlabExpr>, String)
Struct field access: s.field
BinaryOp(String, Box<MatlabExpr>, Box<MatlabExpr>)
Binary operator: a + b, a .* b, a & b
UnaryOp(String, Box<MatlabExpr>, bool)
Unary operator: -x, ~x, x', x.'
IfExpr(Box<MatlabExpr>, Box<MatlabExpr>, Box<MatlabExpr>)
Ternary-style if expression (MATLAB doesn’t have this — emitted as inline)
AnonFunc(Vec<String>, Box<MatlabExpr>)
Anonymous function: @(x, y) x + y
End
End keyword (for indexing)
Colon
Colon alone (:) for all-elements indexing
Nargin
Nargin / nargout
Nargout
Trait Implementations§
Source§impl Clone for MatlabExpr
impl Clone for MatlabExpr
Source§fn clone(&self) -> MatlabExpr
fn clone(&self) -> MatlabExpr
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 MatlabExpr
impl Debug for MatlabExpr
Source§impl Display for MatlabExpr
impl Display for MatlabExpr
Source§impl PartialEq for MatlabExpr
impl PartialEq for MatlabExpr
impl StructuralPartialEq for MatlabExpr
Auto Trait Implementations§
impl Freeze for MatlabExpr
impl RefUnwindSafe for MatlabExpr
impl Send for MatlabExpr
impl Sync for MatlabExpr
impl Unpin for MatlabExpr
impl UnsafeUnpin for MatlabExpr
impl UnwindSafe for MatlabExpr
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