columnar

Trait 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.

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 Columnar for bool

Source§

type Ref<'a> = bool

Source§

type Container = Bools

Source§

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

Source§

impl Columnar for f32

Source§

type Ref<'a> = &'a f32

Source§

type Container = Vec<f32>

Source§

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

Source§

impl Columnar for f64

Source§

type Ref<'a> = &'a f64

Source§

type Container = Vec<f64>

Source§

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

Source§

impl Columnar for i8

Source§

type Ref<'a> = &'a i8

Source§

type Container = Vec<i8>

Source§

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

Source§

impl Columnar for i16

Source§

type Ref<'a> = &'a i16

Source§

type Container = Vec<i16>

Source§

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

Source§

impl Columnar for i32

Source§

type Ref<'a> = &'a i32

Source§

type Container = Vec<i32>

Source§

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

Source§

impl Columnar for i64

Source§

type Ref<'a> = &'a i64

Source§

type Container = Vec<i64>

Source§

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

Source§

impl Columnar for i128

Source§

type Ref<'a> = &'a i128

Source§

type Container = Vec<i128>

Source§

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

Source§

impl Columnar for isize

Source§

type Ref<'a> = isize

Source§

type Container = Isizes

Source§

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

Source§

impl Columnar for u8

Source§

type Ref<'a> = &'a u8

Source§

type Container = Vec<u8>

Source§

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

Source§

impl Columnar for u16

Source§

type Ref<'a> = &'a u16

Source§

type Container = Vec<u16>

Source§

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

Source§

impl Columnar for u32

Source§

type Ref<'a> = &'a u32

Source§

type Container = Vec<u32>

Source§

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

Source§

impl Columnar for u64

Source§

type Ref<'a> = &'a u64

Source§

type Container = Vec<u64>

Source§

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

Source§

impl Columnar for u128

Source§

type Ref<'a> = &'a u128

Source§

type Container = Vec<u128>

Source§

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

Source§

impl Columnar for ()

Source§

type Ref<'a> = ()

Source§

type Container = Empties

Source§

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

Source§

impl Columnar for usize

Source§

type Ref<'a> = usize

Source§

type Container = Usizes

Source§

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

Source§

impl Columnar for String

Source§

type Ref<'a> = &'a str

Source§

type Container = Strings

Source§

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

Source§

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

Source§

impl Columnar for Duration

Source§

type Ref<'a> = Duration

Source§

type Container = Durations

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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§

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

Source§

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

Source§

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

Source§

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

Source§

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§

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

Source§

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

Source§

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

Source§

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

Source§

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§

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

Source§

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

Source§

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

Source§

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

Source§

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§

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§

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

Source§

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

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)

Source§

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§

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§

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

Source§

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

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)

Source§

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§

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§

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

Source§

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

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)

Source§

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§

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§

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

Source§

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

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)

Source§

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§

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§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<T: Columnar, const N: usize> Columnar for [T; N]

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§