Trait Create

Source
pub trait Create<T>
where T: ?Sized,
{ // Required methods fn create() -> Self; fn create_with_capacity(_: usize) -> Self; fn add_element(self, _: T) -> Self; }

Required Methods§

Source

fn create() -> Self

Source

fn create_with_capacity(_: usize) -> Self

Source

fn add_element(self, _: T) -> 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.

Implementations on Foreign Types§

Source§

impl Create<char> for String

Source§

fn create() -> Self

Source§

fn create_with_capacity(capacity: usize) -> Self

Source§

fn add_element(self, ch: char) -> Self

Source§

impl<K, V> Create<(K, V)> for BTreeMap<K, V>
where K: Eq + Ord,

Source§

fn create() -> Self

Source§

fn create_with_capacity(_: usize) -> Self

Source§

fn add_element(self, (key, value): (K, V)) -> Self

Source§

impl<K, V, S> Create<(K, V)> for HashMap<K, V, S>
where K: Eq + Hash, S: Default + BuildHasher,

Source§

fn create() -> Self

Source§

fn create_with_capacity(_: usize) -> Self

Source§

fn add_element(self, (key, value): (K, V)) -> Self

Source§

impl<T> Create<T> for LinkedList<T>

Source§

fn create() -> Self

Source§

fn create_with_capacity(_: usize) -> Self

Source§

fn add_element(self, value: T) -> Self

Source§

impl<T> Create<T> for VecDeque<T>

Source§

fn create() -> Self

Source§

fn create_with_capacity(capacity: usize) -> Self

Source§

fn add_element(self, value: T) -> Self

Source§

impl<T> Create<T> for Vec<T>

Source§

fn create() -> Self

Source§

fn create_with_capacity(capacity: usize) -> Self

Source§

fn add_element(self, value: T) -> Self

Source§

impl<V> Create<V> for BinaryHeap<V>
where V: Ord,

Source§

fn create() -> Self

Source§

fn create_with_capacity(_: usize) -> Self

Source§

fn add_element(self, value: V) -> Self

Source§

impl<V> Create<V> for BTreeSet<V>
where V: Eq + Ord,

Source§

fn create() -> Self

Source§

fn create_with_capacity(_: usize) -> Self

Source§

fn add_element(self, value: V) -> Self

Source§

impl<V, S> Create<V> for HashSet<V, S>
where V: Eq + Hash, S: Default + BuildHasher,

Source§

fn create() -> Self

Source§

fn create_with_capacity(_: usize) -> Self

Source§

fn add_element(self, value: V) -> Self

Implementors§