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§
sourcetype Key: ToJSValConvertible + Clone
type Key: ToJSValConvertible + Clone
The type of the key of the set.