Trait Static

Source
pub trait Static
where Self: Sized,
{ // Required methods fn len(&self) -> usize; fn merge_with(self, other: Self) -> Self; }
Expand description

A trait that a static container must implement to become dynamizable.

Required Methods§

Source

fn len(&self) -> usize

Size of the container.

Best measured with the number of single-element insertions needed to make such a container.

If the size can’t be determined (i.e. the container doesn’t have any way of defining single-element insertion), return 1 and use some strategy which doesn’t rely on knowing correct sizes: e.g. SimpleBinary or SkewBinary.

Source

fn merge_with(self, other: Self) -> Self

Merges two containers into one.

One possible way to implement this is to collect both containers and then make a new container from all the elements collected.

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.

Implementors§

Source§

impl<T: Ord> Static for SortedVec<T>