MatFile

Struct MatFile 

Source
pub struct MatFile { /* private fields */ }
Expand description

MAT-file container

Stores MAT-file variables using a variable name as unique key.

Implementations§

Source§

impl MatFile

Source

pub fn new() -> Self

Create empty MatFile.

Source

pub fn insert(&mut self, name: &str, value: MatVariable)

Insert a MatVariable called name.

A valid MATLAB variable

  • has a length between 1 and 64 characters,
  • starts with a ascii alphabetic character,
  • contains only ascii alpha-numeric or underscore characters,
  • does not match any reserved keyword.

See also here.

§Panics

Panics, if name does not meet the criteria for a valid MATLAB variable name.

Source

pub fn take(&mut self, name: &str) -> Option<MatVariable>

Take variable out of container.

Returns MatVariable stored under name. If not existing, returns None.

Source

pub fn contains(&self, name: &str) -> bool

Return if variable name exists.

Source

pub fn iter(&self) -> Iter<'_, String, MatVariable>

Return iterator over variables.

Source

pub fn iter_mut(&mut self) -> IterMut<'_, String, MatVariable>

Return mutable iterator over variables.

Trait Implementations§

Source§

impl Debug for MatFile

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MatFile

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Index<&str> for MatFile

Source§

type Output = MatVariable

The returned type after indexing.
Source§

fn index(&self, index: &str) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl IntoIterator for MatFile

Source§

type Item = (String, MatVariable)

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<String, MatVariable>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.