Struct arret_runtime::boxed::Vector[][src]

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

Immutable vector of boxed values

This allows random access to any of its values.

Implementations

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

pub const MAX_INLINE_LEN: usize[src]

Maximum element length of an inline vector

pub const EXTERNAL_INLINE_LEN: u32[src]

Inline element length used for external vectors

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

Constructs a new vector with the passed boxed values

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

Constructs a vector by constructing an iterator of values

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

Returns the length of the vector

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

Returns true if the vector is empty

pub fn get(&self, index: usize) -> Option<Gc<T>>[src]

Return an element as the provided index

pub fn iter<'a>(&'a self) -> Box<dyn ExactSizeIterator<Item = Gc<T>> + 'a>[src]

Returns an iterator over the vector

pub fn assoc(
    &self,
    heap: &mut impl AsHeap,
    index: usize,
    value: Gc<T>
) -> Gc<Vector<T>>
[src]

Returns a new vector with the element at the given index replaced

pub fn append(
    &self,
    heap: &mut impl AsHeap,
    other: Gc<Vector<T>>
) -> Gc<Vector<T>>
[src]

Appends the elements in the passed vector and returns a new vector

pub fn extend(
    &self,
    heap: &mut impl AsHeap,
    new_values: impl ExactSizeIterator<Item = Gc<T>>
) -> Gc<Vector<T>>
[src]

Returns a new vector extended with the values in the passed iterator

pub fn take(&self, heap: &mut impl AsHeap, count: usize) -> Gc<Vector<T>>[src]

Takes the first count items from the vector

Trait Implementations

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

impl ConstTagged for Vector[src]

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

impl DistinctTagged for Vector[src]

impl<T: Boxed> Drop for Vector<T>[src]

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

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

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

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for Vector<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.