Trait RecursiveVariadic

Source
pub trait RecursiveVariadic {
    // Required methods
    fn get<N: Key>(&self) -> Option<&N::Value>;
    fn get_mut<N: Key>(&mut self) -> Option<&mut N::Value>;

    // Provided methods
    fn and<N: Key>(self, val: N::Value) -> Entry<N, Self>
       where Self: Sized { ... }
    fn and_default<N: Key>(self) -> Entry<N, Self>
       where N::Value: Default,
             Self: Sized { ... }
}
Expand description

The building block trait for recursive variadics.

Required Methods§

Source

fn get<N: Key>(&self) -> Option<&N::Value>

Try to get the value for N.

Source

fn get_mut<N: Key>(&mut self) -> Option<&mut N::Value>

Try to get the value for N mutably.

Provided Methods§

Source

fn and<N: Key>(self, val: N::Value) -> Entry<N, Self>
where Self: Sized,

Add a key-value pair to this.

Source

fn and_default<N: Key>(self) -> Entry<N, Self>
where N::Value: Default, Self: Sized,

Add the default value for N

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§