Struct arret_runtime::boxed::List [−][src]
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]
impl<T: Boxed> List<T>
[src]pub fn new(
heap: &mut impl AsHeap,
elems: impl ExactSizeIterator<Item = Gc<T>>
) -> Gc<List<T>>
[src]
heap: &mut impl AsHeap,
elems: impl ExactSizeIterator<Item = Gc<T>>
) -> Gc<List<T>>
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]
heap: &mut impl AsHeap,
elems: impl ExactSizeIterator<Item = Gc<T>>,
tail: Gc<List<T>>
) -> Gc<List<T>>
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]
heap: &mut impl AsHeap,
values: impl Iterator<Item = V>,
cons: F
) -> Gc<List<T>> where
F: Fn(&mut Heap, V) -> Gc<T>,
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> EncodeBoxedAbiType for List<T> where
T: EncodeBoxedAbiType,
[src]
impl<T: Boxed> EncodeBoxedAbiType for List<T> where
T: EncodeBoxedAbiType,
[src]const BOXED_ABI_TYPE: BoxedAbiType
[src]
impl<T: Boxed> HashInHeap for List<T>
[src]
impl<T: Boxed> HashInHeap for List<T>
[src]fn hash_in_heap<H: Hasher>(&self, heap: &Heap, state: &mut H)
[src]
impl<T: Boxed> PartialEqInHeap for List<T>
[src]
impl<T: Boxed> PartialEqInHeap for List<T>
[src]fn eq_in_heap(&self, heap: &Heap, other: &List<T>) -> bool
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for List<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for List<T> where
T: Send,
T: Send,
impl<T> Sync for List<T> where
T: Sync,
T: Sync,
impl<T> Unpin for List<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for List<T> where
T: UnwindSafe,
T: UnwindSafe,