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