Skip to main content

TupleBuilder

Trait TupleBuilder 

Source
pub trait TupleBuilder: Builder {
    // Required methods
    fn new(factories: &<Self::Trie as Trie>::Factories) -> Self;
    fn with_capacity(
        factories: &<Self::Trie as Trie>::Factories,
        capacity: usize,
    ) -> Self;
    fn reserve_tuples(&mut self, additional: usize);
    fn push_tuple(&mut self, tuple: <Self::Trie as Trie>::Item<'_>);
    fn push_refs(&mut self, tuple: <Self::Trie as Trie>::ItemRef<'_>);
    fn tuples(&self) -> usize;

    // Provided method
    fn extend_tuples<'a, I>(&'a mut self, tuples: I)
       where I: IntoIterator<Item = <Self::Trie as Trie>::Item<'a>> { ... }
}
Expand description

A type used to assemble collections from ordered sequences of tuples.

Required Methods§

Source

fn new(factories: &<Self::Trie as Trie>::Factories) -> Self

Allocates a new builder.

Source

fn with_capacity( factories: &<Self::Trie as Trie>::Factories, capacity: usize, ) -> Self

Allocates a new builder with capacity for at least cap tuples.

Source

fn reserve_tuples(&mut self, additional: usize)

Reserve space for additional new tuples to be added to the current builder

Source

fn push_tuple(&mut self, tuple: <Self::Trie as Trie>::Item<'_>)

Inserts a new tuple into the current builder

Source

fn push_refs(&mut self, tuple: <Self::Trie as Trie>::ItemRef<'_>)

Source

fn tuples(&self) -> usize

Provided Methods§

Source

fn extend_tuples<'a, I>(&'a mut self, tuples: I)
where I: IntoIterator<Item = <Self::Trie as Trie>::Item<'a>>,

Inserts all of the given tuples into the current builder

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl TupleBuilder for ()

Source§

fn new(_vtables: &()) -> Self

Source§

fn with_capacity(_vtables: &(), _capacity: usize) -> Self

Source§

fn reserve_tuples(&mut self, _additional: usize)

Source§

fn push_tuple(&mut self, _tuple: <Self::Trie as Trie>::Item<'_>)

Source§

fn push_refs(&mut self, _tuple: <Self::Trie as Trie>::ItemRef<'_>)

Source§

fn tuples(&self) -> usize

Implementors§

Source§

impl<K, L, O> TupleBuilder for LayerBuilder<K, L, O>
where K: DataTrait + ?Sized, L: TupleBuilder, O: OrdOffset,

Source§

impl<K: DataTrait + ?Sized, R: WeightTrait + ?Sized> TupleBuilder for LeafBuilder<K, R>