pub trait ScalarVectorBuilder: MutableVector {
type VectorType: ScalarVector<Builder = Self>;
// Required methods
fn with_capacity(capacity: usize) -> Self;
fn push(
&mut self,
value: Option<<Self::VectorType as ScalarVector>::RefItem<'_>>,
);
fn finish(&mut self) -> Self::VectorType;
fn finish_cloned(&self) -> Self::VectorType;
}
Expand description
A trait over all vector builders.
Required Associated Types§
type VectorType: ScalarVector<Builder = Self>
Required Methods§
Sourcefn with_capacity(capacity: usize) -> Self
fn with_capacity(capacity: usize) -> Self
Create a new builder with initial capacity
.
Sourcefn push(
&mut self,
value: Option<<Self::VectorType as ScalarVector>::RefItem<'_>>,
)
fn push( &mut self, value: Option<<Self::VectorType as ScalarVector>::RefItem<'_>>, )
Push a value into the builder.
Sourcefn finish(&mut self) -> Self::VectorType
fn finish(&mut self) -> Self::VectorType
Build a new vector and reset self
.
Sourcefn finish_cloned(&self) -> Self::VectorType
fn finish_cloned(&self) -> Self::VectorType
Build a new vector without resetting self
.
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.