pub struct MatFile { /* private fields */ }
Expand description
MatFile is a collection of named arrays.
You can load a “.mat” file from disk like this:
let file = std::fs::File::open("tests/double.mat")?;
let mat_file = matfile::MatFile::parse(file)?;
Implementations§
source§impl MatFile
impl MatFile
sourcepub fn parse<R: Read>(reader: R) -> Result<Self, Error>
pub fn parse<R: Read>(reader: R) -> Result<Self, Error>
Tries to parse a byte sequence as a “.mat” file.
sourcepub fn arrays(&self) -> &Vec<Array>
pub fn arrays(&self) -> &Vec<Array>
List of all arrays in this .mat file.
When parsing a .mat file all arrays of unsupported type (currently all non-numerical and sparse arrays) will be ignored and will thus not be part of this list.
sourcepub fn find_by_name<'me>(&'me self, name: &str) -> Option<&'me Array>
pub fn find_by_name<'me>(&'me self, name: &str) -> Option<&'me Array>
Returns an array with the given name if it exists. Case sensitive.
When parsing a .mat file all arrays of unsupported type (currently all non-numerical and sparse arrays) will be ignored and will thus not be returned by this function.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for MatFile
impl Send for MatFile
impl Sync for MatFile
impl Unpin for MatFile
impl UnwindSafe for MatFile
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