Trait Columnar

Source
pub trait Columnar: 'static {
    type Container: ContainerBytes + for<'a> Push<&'a Self>;

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

    // Provided methods
    fn copy_from<'a>(&mut self, other: Ref<'a, Self>)
       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 { ... }
    fn reborrow<'b, 'a: 'b>(thing: Ref<'a, Self>) -> Ref<'b, Self> { ... }
}
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 Container: ContainerBytes + for<'a> Push<&'a 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: Ref<'a, Self>) -> Self

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

Provided Methods§

Source

fn copy_from<'a>(&mut self, other: Ref<'a, Self>)
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.

Source

fn reborrow<'b, 'a: 'b>(thing: Ref<'a, Self>) -> Ref<'b, Self>

Reborrows the reference type to a shorter lifetime.

Implementations must not change the contents of the reference, and should mark the function as #[inline(always)]. It is no-op to overcome limitations of the borrow checker. In many cases, it is enough to return thing as-is.

For example, when comparing two references Ref<'a> and Ref<'b>, we can reborrow both to a local lifetime to compare them. This allows us to keep the lifetimes 'a and 'b separate, while otherwise Rust would unify them.

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 Container = Bools

Source§

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

Source§

impl Columnar for char

Source§

type Container = Chars

Source§

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

Source§

impl Columnar for f32

Source§

type Container = Vec<f32>

Source§

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

Source§

impl Columnar for f64

Source§

type Container = Vec<f64>

Source§

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

Source§

impl Columnar for i8

Source§

type Container = Vec<i8>

Source§

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

Source§

impl Columnar for i16

Source§

type Container = Vec<i16>

Source§

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

Source§

impl Columnar for i32

Source§

type Container = Vec<i32>

Source§

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

Source§

impl Columnar for i64

Source§

type Container = Vec<i64>

Source§

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

Source§

impl Columnar for i128

Source§

type Container = I128s

Source§

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

Source§

impl Columnar for isize

Source§

type Container = Isizes

Source§

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

Source§

impl Columnar for u8

Source§

type Container = Vec<u8>

Source§

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

Source§

impl Columnar for u16

Source§

type Container = Vec<u16>

Source§

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

Source§

impl Columnar for u32

Source§

type Container = Vec<u32>

Source§

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

Source§

impl Columnar for u64

Source§

type Container = Vec<u64>

Source§

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

Source§

impl Columnar for u128

Source§

type Container = U128s

Source§

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

Source§

impl Columnar for ()

Source§

type Container = Empties

Source§

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

Source§

impl Columnar for usize

Source§

type Container = Usizes

Source§

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

Source§

impl Columnar for String

Source§

type Container = Strings

Source§

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

Source§

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

Source§

impl Columnar for Wrapping<i8>

Source§

type Container = Vec<Wrapping<i8>>

Source§

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

Source§

impl Columnar for Wrapping<i16>

Source§

type Container = Vec<Wrapping<i16>>

Source§

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

Source§

impl Columnar for Wrapping<i32>

Source§

type Container = Vec<Wrapping<i32>>

Source§

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

Source§

impl Columnar for Wrapping<i64>

Source§

type Container = Vec<Wrapping<i64>>

Source§

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

Source§

impl Columnar for Wrapping<u8>

Source§

type Container = Vec<Wrapping<u8>>

Source§

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

Source§

impl Columnar for Wrapping<u16>

Source§

type Container = Vec<Wrapping<u16>>

Source§

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

Source§

impl Columnar for Wrapping<u32>

Source§

type Container = Vec<Wrapping<u32>>

Source§

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

Source§

impl Columnar for Wrapping<u64>

Source§

type Container = Vec<Wrapping<u64>>

Source§

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

Source§

impl Columnar for Duration

Source§

type Container = Durations

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

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: Ref<'a, Self>)

Source§

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

Source§

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

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: Ref<'a, Self>)

Source§

fn into_owned<'a>(other: Ref<'a, Self>) -> 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 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: Ref<'a, Self>)

Source§

fn into_owned<'a>(other: Ref<'a, Self>) -> 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 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: Ref<'a, Self>)

Source§

fn into_owned<'a>(other: Ref<'a, Self>) -> 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 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: Ref<'a, Self>)

Source§

fn into_owned<'a>(other: Ref<'a, Self>) -> 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 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: Ref<'a, Self>)

Source§

fn into_owned<'a>(other: Ref<'a, Self>) -> 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 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: Ref<'a, Self>)

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§