Skip to main content

MiraArray

Trait MiraArray 

Source
pub trait MiraArray: 'static {
    // Required methods
    fn len(&self) -> usize;
    fn get(&self, index: usize) -> Result<Option<MiraAny>>;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

A live Rust value that appears as a read-only MiraScript array.

Required Methods§

Source

fn len(&self) -> usize

Return the current array length.

Source

fn get(&self, index: usize) -> Result<Option<MiraAny>>

Read an element, returning None when the index is out of bounds.

Provided Methods§

Source

fn is_empty(&self) -> bool

Return whether this array currently contains no elements.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§