pub trait MatlabClass<P>: Sized + Deref<Target = mxArray_tag> {
type Owned;
// Required methods
fn from_mx_array(mx: P) -> Result<Self, FromMatlabError<P>>;
fn into_inner(self) -> P;
fn inner(&self) -> &P;
fn duplicate(&self) -> Self::Owned;
}Expand description
Base Matlab class trait. Matlab classes, in Rustmex, are wrapper structures around a
bare MatlabPtr, giving them some type information.
Required Associated Types§
Required Methods§
Sourcefn from_mx_array(mx: P) -> Result<Self, FromMatlabError<P>>
fn from_mx_array(mx: P) -> Result<Self, FromMatlabError<P>>
Try to build a matlab class from a MatlabPtr. If the type requirements of
the class match what the pointer is, then the class is constructed. Otherwise,
an error is returned; containing the reason of the failure and the original
pointer. The latter is especially useful with MxArrays; the owned
MatlabPtr type — otherwise it would be dropped.
Sourcefn into_inner(self) -> P
fn into_inner(self) -> P
Deconstruct the MatlabClass back to a bare MatlabPtr.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.