FormatOptions

Struct FormatOptions 

Source
pub struct FormatOptions {
    pub column_delimiter: String,
    pub row_delimiter: String,
}
Expand description

FormatOptions controls the parsing and string formatting of matrices.

Fields§

§column_delimiter: String

This element, which can be the empty string, will be present between each column, but not at the start or end of each row.

§row_delimiter: String

This element, which must not be the empty string, will delimit the rows of the matrix.

Implementations§

Source§

impl FormatOptions

Source

pub fn parse_matrix<T, I>( &self, text_matrix: &str, parse_entry: fn(&str) -> T, ) -> Result<DenseMatrix<T, I>>
where T: 'static, I: Coordinate,

parse_matrix takes a text representation of a matrix and a converter function and returns a DenseMatrix representing the same matrix. The number of parsed entries in each row must be the same.

Source

pub fn format<'a, 'b: 'a, T, I>( &'a self, matrix: &'b dyn Matrix<'a, T, I>, format_element: fn(&T) -> String, ) -> String
where T: 'static, I: Coordinate,

Render a matrix to a string.

Trait Implementations§

Source§

impl Default for FormatOptions

Source§

fn default() -> Self

Returns the “default value” for a type. 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.