Skip to main content

List

Trait List 

Source
pub trait List {
    // Required methods
    fn len(&self) -> usize;
    fn get(&self, index: usize) -> Value<'_>;

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

A sequence a template can loop over.

Required Methods§

Source

fn len(&self) -> usize

The number of items.

Source

fn get(&self, index: usize) -> Value<'_>

An item, or Value::Absent past the end.

Provided Methods§

Source

fn is_empty(&self) -> bool

Whether the list is empty.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§