Trait script::dom::bindings::like::Setlike

source ·
pub trait Setlike {
    type Key: ToJSValConvertible + Clone;

    // Required methods
    fn get_index(&self, index: u32) -> Option<Self::Key>;
    fn size(&self) -> u32;
    fn add(&self, key: Self::Key);
    fn has(&self, key: Self::Key) -> bool;
    fn clear(&self);
    fn delete(&self, key: Self::Key) -> bool;
}
Expand description

Every Setlike dom_struct must implement this to provide access to underlying storage so codegen can automatically generate all setlike methods

In case you use a type that implements Setlike as underlying storage it’s recommended to use setlike macro.

Required Associated Types§

source

type Key: ToJSValConvertible + Clone

The type of the key of the set.

Required Methods§

source

fn get_index(&self, index: u32) -> Option<Self::Key>

source

fn size(&self) -> u32

source

fn add(&self, key: Self::Key)

source

fn has(&self, key: Self::Key) -> bool

source

fn clear(&self)

source

fn delete(&self, key: Self::Key) -> bool

Implementors§