tabled

Trait Tabled

Source
pub trait Tabled {
    const LENGTH: usize;

    // Required methods
    fn fields(&self) -> Vec<Cow<'_, str>>;
    fn headers() -> Vec<Cow<'static, str>>;
}
Expand description

Tabled a trait responsible for providing a header fields and a row fields.

It’s urgent that header len is equal to fields len.

Self::headers().len() == self.fields().len()

Required Associated Constants§

Source

const LENGTH: usize

A length of fields and headers, which must be the same.

Required Methods§

Source

fn fields(&self) -> Vec<Cow<'_, str>>

Fields method must return a list of cells.

The cells will be placed in the same row, preserving the order.

Source

fn headers() -> Vec<Cow<'static, str>>

Headers must return a list of column names.

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.

Implementations on Foreign Types§

Source§

impl Tabled for &str

Source§

const LENGTH: usize = 1usize

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl Tabled for bool

Source§

const LENGTH: usize = 1usize

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl Tabled for char

Source§

const LENGTH: usize = 1usize

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl Tabled for f32

Source§

const LENGTH: usize = 1usize

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl Tabled for f64

Source§

const LENGTH: usize = 1usize

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl Tabled for i8

Source§

const LENGTH: usize = 1usize

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl Tabled for i16

Source§

const LENGTH: usize = 1usize

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl Tabled for i32

Source§

const LENGTH: usize = 1usize

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl Tabled for i64

Source§

const LENGTH: usize = 1usize

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl Tabled for i128

Source§

const LENGTH: usize = 1usize

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl Tabled for isize

Source§

const LENGTH: usize = 1usize

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl Tabled for str

Source§

const LENGTH: usize = 1usize

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl Tabled for u8

Source§

const LENGTH: usize = 1usize

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl Tabled for u16

Source§

const LENGTH: usize = 1usize

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl Tabled for u32

Source§

const LENGTH: usize = 1usize

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl Tabled for u64

Source§

const LENGTH: usize = 1usize

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl Tabled for u128

Source§

const LENGTH: usize = 1usize

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl Tabled for usize

Source§

const LENGTH: usize = 1usize

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl Tabled for String

Source§

const LENGTH: usize = 1usize

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl<A: Tabled> Tabled for (A,)

Source§

const LENGTH: usize = _

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl<A: Tabled, B: Tabled> Tabled for (A, B)

Source§

const LENGTH: usize = _

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl<A: Tabled, B: Tabled, C: Tabled> Tabled for (A, B, C)

Source§

const LENGTH: usize = _

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl<A: Tabled, B: Tabled, C: Tabled, D: Tabled> Tabled for (A, B, C, D)

Source§

const LENGTH: usize = _

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl<A: Tabled, B: Tabled, C: Tabled, D: Tabled, E: Tabled> Tabled for (A, B, C, D, E)

Source§

const LENGTH: usize = _

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl<A: Tabled, B: Tabled, C: Tabled, D: Tabled, E: Tabled, F: Tabled> Tabled for (A, B, C, D, E, F)

Source§

const LENGTH: usize = _

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl<T> Tabled for &T
where T: Tabled,

Source§

const LENGTH: usize = T::LENGTH

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl<T> Tabled for Box<T>
where T: Tabled,

Source§

const LENGTH: usize = T::LENGTH

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Source§

impl<T, const N: usize> Tabled for [T; N]
where T: Display,

Source§

const LENGTH: usize = N

Source§

fn fields(&self) -> Vec<Cow<'_, str>>

Source§

fn headers() -> Vec<Cow<'static, str>>

Implementors§