Trait columnar::Columnar

source ·
pub trait Columnar: 'static {
    type Ref<'a>;
    type Container: Len + Clear + Default + for<'a> Push<&'a Self> + for<'a> Push<Self::Ref<'a>> + Container<Self>;

    // Required method
    fn into_owned<'a>(other: Self::Ref<'a>) -> Self;

    // Provided methods
    fn copy_from<'a>(&mut self, other: Self::Ref<'a>)
       where Self: Sized { ... }
    fn as_columns<'a, I>(selves: I) -> Self::Container
       where I: IntoIterator<Item = &'a Self>,
             Self: 'a { ... }
    fn into_columns<I>(selves: I) -> Self::Container
       where I: IntoIterator<Item = Self>,
             Self: Sized { ... }
}
Expand description

A type that can be represented in columnar form.

For a running example, a type like (A, Vec<B>).

Required Associated Types§

source

type Ref<'a>

For each lifetime, a reference with that lifetime.

As an example, (&'a A, &'a [B]).

source

type Container: Len + Clear + Default + for<'a> Push<&'a Self> + for<'a> Push<Self::Ref<'a>> + Container<Self>

The type that stores the columnar representation.

The container must support pushing both &Self and Self::Ref<'_>. In our running example this might be (Vec<A>, Vecs<Vec<B>>).

Required Methods§

source

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

Produce an instance of Self from Self::Ref<'a>.

Provided Methods§

source

fn copy_from<'a>(&mut self, other: Self::Ref<'a>)
where Self: Sized,

Repopulates self from a reference.

By default this just calls into_owned(), but it can be overridden.

source

fn as_columns<'a, I>(selves: I) -> Self::Container
where I: IntoIterator<Item = &'a Self>, Self: 'a,

Converts a sequence of the references to the type into columnar form.

source

fn into_columns<I>(selves: I) -> Self::Container
where I: IntoIterator<Item = Self>, Self: Sized,

Converts a sequence of the type into columnar form.

This consumes the owned Self types but uses them only by reference. Consider as_columns() instead if it is equally ergonomic.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Columnar for bool

§

type Ref<'a> = bool

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = Bools

source§

impl Columnar for f32

§

type Ref<'a> = &'a f32

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = Vec<f32>

source§

impl Columnar for f64

§

type Ref<'a> = &'a f64

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = Vec<f64>

source§

impl Columnar for i8

§

type Ref<'a> = &'a i8

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = Vec<i8>

source§

impl Columnar for i16

§

type Ref<'a> = &'a i16

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = Vec<i16>

source§

impl Columnar for i32

§

type Ref<'a> = &'a i32

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = Vec<i32>

source§

impl Columnar for i64

§

type Ref<'a> = &'a i64

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = Vec<i64>

source§

impl Columnar for i128

§

type Ref<'a> = &'a i128

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = Vec<i128>

source§

impl Columnar for isize

§

type Ref<'a> = isize

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = Isizes

source§

impl Columnar for u8

§

type Ref<'a> = &'a u8

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = Vec<u8>

source§

impl Columnar for u16

§

type Ref<'a> = &'a u16

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = Vec<u16>

source§

impl Columnar for u32

§

type Ref<'a> = &'a u32

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = Vec<u32>

source§

impl Columnar for u64

§

type Ref<'a> = &'a u64

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = Vec<u64>

source§

impl Columnar for u128

§

type Ref<'a> = &'a u128

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = Vec<u128>

source§

impl Columnar for ()

§

type Ref<'a> = ()

source§

fn into_owned<'a>(_other: Self::Ref<'a>) -> Self

§

type Container = Empties

source§

impl Columnar for usize

§

type Ref<'a> = usize

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = Usizes

source§

impl Columnar for String

§

type Ref<'a> = &'a str

source§

fn copy_from<'a>(&mut self, other: Self::Ref<'a>)

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = Strings

source§

impl Columnar for Duration

§

type Ref<'a> = Duration

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = Durations

source§

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

§

type Ref<'a> = (<A as Columnar>::Ref<'a>,) where A: 'a

source§

fn copy_from<'a>(&mut self, other: Self::Ref<'a>)

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = (<A as Columnar>::Container,)

source§

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

§

type Ref<'a> = (<A as Columnar>::Ref<'a>, <B as Columnar>::Ref<'a>) where A: 'a, B: 'a

source§

fn copy_from<'a>(&mut self, other: Self::Ref<'a>)

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = (<A as Columnar>::Container, <B as Columnar>::Container)

source§

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

§

type Ref<'a> = (<A as Columnar>::Ref<'a>, <B as Columnar>::Ref<'a>, <C as Columnar>::Ref<'a>) where A: 'a, B: 'a, C: 'a

source§

fn copy_from<'a>(&mut self, other: Self::Ref<'a>)

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = (<A as Columnar>::Container, <B as Columnar>::Container, <C as Columnar>::Container)

source§

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

§

type Ref<'a> = (<A as Columnar>::Ref<'a>, <B as Columnar>::Ref<'a>, <C as Columnar>::Ref<'a>, <D as Columnar>::Ref<'a>) where A: 'a, B: 'a, C: 'a, D: 'a

source§

fn copy_from<'a>(&mut self, other: Self::Ref<'a>)

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = (<A as Columnar>::Container, <B as Columnar>::Container, <C as Columnar>::Container, <D as Columnar>::Container)

source§

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

§

type Ref<'a> = (<A as Columnar>::Ref<'a>, <B as Columnar>::Ref<'a>, <C as Columnar>::Ref<'a>, <D as Columnar>::Ref<'a>, <E as Columnar>::Ref<'a>) where A: 'a, B: 'a, C: 'a, D: 'a, E: 'a

source§

fn copy_from<'a>(&mut self, other: Self::Ref<'a>)

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = (<A as Columnar>::Container, <B as Columnar>::Container, <C as Columnar>::Container, <D as Columnar>::Container, <E as Columnar>::Container)

source§

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

§

type Ref<'a> = (<A as Columnar>::Ref<'a>, <B as Columnar>::Ref<'a>, <C as Columnar>::Ref<'a>, <D as Columnar>::Ref<'a>, <E as Columnar>::Ref<'a>, <F as Columnar>::Ref<'a>) where A: 'a, B: 'a, C: 'a, D: 'a, E: 'a, F: 'a

source§

fn copy_from<'a>(&mut self, other: Self::Ref<'a>)

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = (<A as Columnar>::Container, <B as Columnar>::Container, <C as Columnar>::Container, <D as Columnar>::Container, <E as Columnar>::Container, <F as Columnar>::Container)

source§

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

§

type Ref<'a> = (<A as Columnar>::Ref<'a>, <B as Columnar>::Ref<'a>, <C as Columnar>::Ref<'a>, <D as Columnar>::Ref<'a>, <E as Columnar>::Ref<'a>, <F as Columnar>::Ref<'a>, <G as Columnar>::Ref<'a>) where A: 'a, B: 'a, C: 'a, D: 'a, E: 'a, F: 'a, G: 'a

source§

fn copy_from<'a>(&mut self, other: Self::Ref<'a>)

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = (<A as Columnar>::Container, <B as Columnar>::Container, <C as Columnar>::Container, <D as Columnar>::Container, <E as Columnar>::Container, <F as Columnar>::Container, <G as Columnar>::Container)

source§

impl<A: Columnar, B: Columnar, C: Columnar, D: Columnar, E: Columnar, F: Columnar, G: Columnar, H: Columnar> Columnar for (A, B, C, D, E, F, G, H)

§

type Ref<'a> = (<A as Columnar>::Ref<'a>, <B as Columnar>::Ref<'a>, <C as Columnar>::Ref<'a>, <D as Columnar>::Ref<'a>, <E as Columnar>::Ref<'a>, <F as Columnar>::Ref<'a>, <G as Columnar>::Ref<'a>, <H as Columnar>::Ref<'a>) where A: 'a, B: 'a, C: 'a, D: 'a, E: 'a, F: 'a, G: 'a, H: 'a

source§

fn copy_from<'a>(&mut self, other: Self::Ref<'a>)

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = (<A as Columnar>::Container, <B as Columnar>::Container, <C as Columnar>::Container, <D as Columnar>::Container, <E as Columnar>::Container, <F as Columnar>::Container, <G as Columnar>::Container, <H as Columnar>::Container)

source§

impl<A: Columnar, B: Columnar, C: Columnar, D: Columnar, E: Columnar, F: Columnar, G: Columnar, H: Columnar, I: Columnar> Columnar for (A, B, C, D, E, F, G, H, I)

§

type Ref<'a> = (<A as Columnar>::Ref<'a>, <B as Columnar>::Ref<'a>, <C as Columnar>::Ref<'a>, <D as Columnar>::Ref<'a>, <E as Columnar>::Ref<'a>, <F as Columnar>::Ref<'a>, <G as Columnar>::Ref<'a>, <H as Columnar>::Ref<'a>, <I as Columnar>::Ref<'a>) where A: 'a, B: 'a, C: 'a, D: 'a, E: 'a, F: 'a, G: 'a, H: 'a, I: 'a

source§

fn copy_from<'a>(&mut self, other: Self::Ref<'a>)

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = (<A as Columnar>::Container, <B as Columnar>::Container, <C as Columnar>::Container, <D as Columnar>::Container, <E as Columnar>::Container, <F as Columnar>::Container, <G as Columnar>::Container, <H as Columnar>::Container, <I as Columnar>::Container)

source§

impl<A: Columnar, B: Columnar, C: Columnar, D: Columnar, E: Columnar, F: Columnar, G: Columnar, H: Columnar, I: Columnar, J: Columnar> Columnar for (A, B, C, D, E, F, G, H, I, J)

§

type Ref<'a> = (<A as Columnar>::Ref<'a>, <B as Columnar>::Ref<'a>, <C as Columnar>::Ref<'a>, <D as Columnar>::Ref<'a>, <E as Columnar>::Ref<'a>, <F as Columnar>::Ref<'a>, <G as Columnar>::Ref<'a>, <H as Columnar>::Ref<'a>, <I as Columnar>::Ref<'a>, <J as Columnar>::Ref<'a>) where A: 'a, B: 'a, C: 'a, D: 'a, E: 'a, F: 'a, G: 'a, H: 'a, I: 'a, J: 'a

source§

fn copy_from<'a>(&mut self, other: Self::Ref<'a>)

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = (<A as Columnar>::Container, <B as Columnar>::Container, <C as Columnar>::Container, <D as Columnar>::Container, <E as Columnar>::Container, <F as Columnar>::Container, <G as Columnar>::Container, <H as Columnar>::Container, <I as Columnar>::Container, <J as Columnar>::Container)

source§

impl<S: Columnar, T: Columnar> Columnar for Result<S, T>

§

type Ref<'a> = Result<<S as Columnar>::Ref<'a>, <T as Columnar>::Ref<'a>> where S: 'a, T: 'a

source§

fn copy_from<'a>(&mut self, other: Self::Ref<'a>)

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = Results<<S as Columnar>::Container, <T as Columnar>::Container>

source§

impl<T: Columnar + Default> Columnar for Option<T>

§

type Ref<'a> = Option<<T as Columnar>::Ref<'a>> where T: 'a

source§

fn copy_from<'a>(&mut self, other: Self::Ref<'a>)

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = Options<<T as Columnar>::Container>

source§

impl<T: Columnar> Columnar for Vec<T>

§

type Ref<'a> = Slice<<<T as Columnar>::Container as Container<T>>::Borrowed<'a>> where T: 'a

source§

fn copy_from<'a>(&mut self, other: Self::Ref<'a>)

source§

fn into_owned<'a>(other: Self::Ref<'a>) -> Self

§

type Container = Vecs<<T as Columnar>::Container>

Implementors§