ArrayViewItem

Trait ArrayViewItem 

Source
pub trait ArrayViewItem<H>: Clone + Sized
where H: Eq + Hash + Copy + Clone + Send + Sync + 'static,
{ // Required methods fn to_column(&self, column: H) -> String; fn to_row(&self) -> String; // Provided methods fn columns() -> Vec<(H, String)> { ... } fn to_array_view(items: Vec<Self>) -> ArrayView<Self, H> where Self: Sized { ... } }
Expand description

A trait for displaying items inside an ArrayView.

Required Methods§

Source

fn to_column(&self, column: H) -> String

Method returning a string representation of the item for the specified column from type H.

Source

fn to_row(&self) -> String

Method returning a string representation of the item for the row header.

Provided Methods§

Source

fn columns() -> Vec<(H, String)>

Returns the column definitions used by ArrayViewItem::to_array_view.

The default implementation returns an empty list, creating an ArrayView with no columns.

Source

fn to_array_view(items: Vec<Self>) -> ArrayView<Self, H>
where Self: Sized,

Creates an ArrayView from the provided items.

Columns are populated from ArrayViewItem::columns.

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.

Implementors§