Skip to main content

EmptyList

Trait EmptyList 

Source
pub trait EmptyList {
    type PushFirst<U: 'static>: List;
    type RootEmpty: EmptyList;

    // Required methods
    fn push_first<U: 'static>(self, item: U) -> Self::PushFirst<U>;
    fn root_empty() -> Self::RootEmpty;
}
Expand description

Trait implemented by empty lists to support list construction.

Required Associated Types§

Source

type PushFirst<U: 'static>: List

The result of pushing the first element onto an empty list.

Source

type RootEmpty: EmptyList

The canonical empty list type for this family.

Required Methods§

Source

fn push_first<U: 'static>(self, item: U) -> Self::PushFirst<U>

Push the first element onto an empty list.

Source

fn root_empty() -> Self::RootEmpty

Return the canonical empty list.

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 EmptyList for ()

Source§

type PushFirst<U: 'static> = (U, ())

Source§

type RootEmpty = ()

Source§

fn push_first<U: 'static>(self, item: U) -> Self::PushFirst<U>

Source§

fn root_empty() -> Self::RootEmpty

Implementors§