Trait leer::Empty

source ·
pub trait Empty {
    // Required method
    fn empty() -> Self;
}
Expand description

Types that have a notion of “being empty” and can create such an empty instance.

This is very similar to Default from the standard library, but makes it explicit that the returned instance is empty and not just any default instance. This trait is implemented for several standard types.

Required Methods§

source

fn empty() -> Self

Returns an empty value of this type.

Implementations on Foreign Types§

source§

impl<T: Empty> Empty for Box<T>

source§

fn empty() -> Self

source§

impl Empty for String

source§

fn empty() -> Self

source§

impl<A: Empty, B: Empty> Empty for (A, B)

source§

fn empty() -> Self

source§

impl<T: ?Sized> Empty for PhantomData<T>

source§

fn empty() -> Self

source§

impl<A: Empty, B: Empty, C: Empty, D: Empty> Empty for (A, B, C, D)

source§

fn empty() -> Self

source§

impl<A: Empty, B: Empty, C: Empty> Empty for (A, B, C)

source§

fn empty() -> Self

source§

impl<T> Empty for LinkedList<T>

source§

fn empty() -> Self

source§

impl<T> Empty for Option<T>

source§

fn empty() -> Self

source§

impl<T: Eq + Hash> Empty for HashSet<T>

source§

fn empty() -> Self

source§

impl Empty for ()

source§

fn empty() -> Self

source§

impl<T: Ord> Empty for BTreeSet<T>

source§

fn empty() -> Self

source§

impl<T: Empty, const N: usize> Empty for [T; N]

source§

fn empty() -> Self

source§

impl<K: Eq + Hash, V> Empty for HashMap<K, V>

source§

fn empty() -> Self

source§

impl<T> Empty for VecDeque<T>

source§

fn empty() -> Self

source§

impl<T> Empty for Vec<T>

source§

fn empty() -> Self

source§

impl<A: Empty> Empty for (A,)

source§

fn empty() -> Self

source§

impl<K: Ord, V> Empty for BTreeMap<K, V>

source§

fn empty() -> Self

Implementors§