Trait tabled::Tabled

source ·
pub trait Tabled {
    const LENGTH: usize;

    // Required methods
    fn fields(&self) -> Vec<Cow<'_, str>>;
    fn headers() -> Vec<Cow<'static, str>>;
}
Available on crate feature std only.
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.

Object Safety§

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§