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§
Required Methods§
sourcefn into_owned<'a>(other: Self::Ref<'a>) -> Self
fn into_owned<'a>(other: Self::Ref<'a>) -> Self
Produce an instance of Self
from Self::Ref<'a>
.
Provided Methods§
sourcefn copy_from<'a>(&mut self, other: Self::Ref<'a>)where
Self: Sized,
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.
sourcefn as_columns<'a, I>(selves: I) -> Self::Containerwhere
I: IntoIterator<Item = &'a Self>,
Self: 'a,
fn as_columns<'a, I>(selves: I) -> Self::Containerwhere
I: IntoIterator<Item = &'a Self>,
Self: 'a,
Converts a sequence of the references to the type into columnar form.
sourcefn into_columns<I>(selves: I) -> Self::Containerwhere
I: IntoIterator<Item = Self>,
Self: Sized,
fn into_columns<I>(selves: I) -> Self::Containerwhere
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.