Struct arret_runtime::boxed::List[][src]

#[repr(C, align(16))]
pub struct List<T: Boxed = Any> { /* fields omitted */ }

List of boxed values

This allows O(n) access to its elements. It has the benefit of allowing constant time prepends while sharing the tail of the existing list.

Implementations

impl<T: Boxed> List<T>[src]

pub fn new(
    heap: &mut impl AsHeap,
    elems: impl ExactSizeIterator<Item = Gc<T>>
) -> Gc<List<T>>
[src]

Constructs a new fixed sized list containing the passed elems

pub fn new_with_tail(
    heap: &mut impl AsHeap,
    elems: impl ExactSizeIterator<Item = Gc<T>>,
    tail: Gc<List<T>>
) -> Gc<List<T>>
[src]

Constructs a list with a head of elems and the specified tail list

pub fn empty() -> Gc<List<T>>[src]

Returns an empty list

pub fn from_values<V, F>(
    heap: &mut impl AsHeap,
    values: impl Iterator<Item = V>,
    cons: F
) -> Gc<List<T>> where
    F: Fn(&mut Heap, V) -> Gc<T>, 
[src]

Creates a list by constructing an iterator of values

pub fn as_subtype(&self) -> ListSubtype<'_, T>[src]

Returns a subtype of this list based on its type tag

pub fn len(&self) -> usize[src]

Returns the length of the list

pub fn is_empty(&self) -> bool[src]

Returns true if the list is empty

pub fn iter(&self) -> ListIterator<T>[src]

Returns an iterator to the list’s values

Trait Implementations

impl<T: Boxed> Boxed for List<T>[src]

impl<T: Boxed> Debug for List<T>[src]

impl DistinctTagged for List<Any>[src]

impl<T: Boxed> EncodeBoxedAbiType for List<T> where
    T: EncodeBoxedAbiType
[src]

impl<T: Boxed> HashInHeap for List<T>[src]

impl<T: Boxed> PartialEqInHeap for List<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for List<T> where
    T: RefUnwindSafe

impl<T> Send for List<T> where
    T: Send

impl<T> Sync for List<T> where
    T: Sync

impl<T> Unpin for List<T> where
    T: Unpin

impl<T> UnwindSafe for List<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.