flux_arc_interner

Type Alias List

Source
pub type List<T> = Interned<[T]>;

Aliased Type§

struct List<T> {
    pub(crate) arc: Arc<[T]>,
}

Fields§

§arc: Arc<[T]>

Implementations§

Source§

impl<T> List<T>
where [T]: Internable,

Source

pub(crate) fn list_with<S>( obj: S, to_arc: impl FnOnce(S) -> Arc<[T]>, ) -> List<T>
where S: Borrow<[T]>,

Source

pub fn from_vec(vec: Vec<T>) -> List<T>

Source

pub fn from_arr<const N: usize>(arr: [T; N]) -> List<T>

Source

pub fn empty() -> List<T>

Source

pub fn singleton(x: T) -> List<T>

Source§

impl<T> List<T>
where T: Clone, [T]: Internable,

Source

pub fn from_slice(slice: &[T]) -> List<T>

Trait Implementations§

Source§

impl<T> Default for List<T>
where [T]: Internable,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T> FromIterator<T> for List<T>
where [T]: Internable,

Source§

fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl<T> Ord for List<T>
where T: Ord, [T]: Internable,

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<T> PartialOrd for List<T>

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more