Trait script::dom::bindings::iterable::Iterable

source ·
pub trait Iterable {
    type Key: ToJSValConvertible;
    type Value: ToJSValConvertible;

    // Required methods
    fn get_iterable_length(&self) -> u32;
    fn get_value_at_index(&self, index: u32) -> Self::Value;
    fn get_key_at_index(&self, index: u32) -> Self::Key;
}
Expand description

A DOM object that can be iterated over using a pair value iterator.

Required Associated Types§

source

type Key: ToJSValConvertible

The type of the key of the iterator pair.

source

type Value: ToJSValConvertible

The type of the value of the iterator pair.

Required Methods§

source

fn get_iterable_length(&self) -> u32

Return the number of entries that can be iterated over.

source

fn get_value_at_index(&self, index: u32) -> Self::Value

Return the value at the provided index.

source

fn get_key_at_index(&self, index: u32) -> Self::Key

Return the key at the provided index.

Implementors§