pub trait MaybeArray {
    type Element<'c>;

    fn try_array(&self) -> Result<(), DatumViewError>;
    fn array_len(&self) -> Result<usize, MachineError>;
    fn array_get(
        &self,
        index: usize
    ) -> Result<Self::Element<'static>, MachineError>; fn array_set<'c>(
        &self,
        index: usize,
        element: Self::Element<'c>
    ) -> Result<(), MachineError>; fn array_push<'c>(
        &self,
        element: Self::Element<'c>
    ) -> Result<(), MachineError>; fn array_truncate(&self, len: usize) -> Result<(), MachineError>; fn array_to_iter<'b>(&'b self) -> Result<ArrayIter<'b, Self>, MachineError> { ... } fn array_to_vec(
        &self,
        maxlen: usize
    ) -> Result<Vec<Self::Element<'static>>, MachineError> { ... } }
Expand description

Types that can be an array

Required Associated Types§

Type of elements

Required Methods§

Return error unless datum is an array-like type

Array length

Retrieve element at index

NOTE: If index is out of bounds, may either return error or null

Set element at index

NOTE: If index is out of bounds, may either grow array or return error

Push element to array

Truncate array

Provided Methods§

Create Iterator over entries of array-like datum

Create Vec from array-like datum

Implementors§