Skip to main content

ToList

Trait ToList 

pub trait ToList {
    type ToList<T: EmptyList>: List;

    // Required method
    fn to_list<T>(&self) -> Self::ToList<T>
       where T: EmptyList;
}
Expand description

Converts to a type-level List without consuming the source.

§Examples

A converter retains its source ownership and states whether its fields are borrowed or independently copied; see IntoList for the consuming bridge.

Required Associated Types§

type ToList<T: EmptyList>: List

The resulting List type using T as the empty list type family.

Required Methods§

fn to_list<T>(&self) -> Self::ToList<T>
where T: EmptyList,

Converts to a List using T as the empty list type family.

  • Complexity: The converter’s field borrowing or copying costs.
§Examples

See ToList.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§