pub trait OptionsTrait {
// Provided methods
fn new() -> Self
where Self: JsCast { ... }
fn initialize(self) -> Self
where Self: JsCast { ... }
fn set(self, key: &str, value: JsValue) -> Self
where Self: JsCast { ... }
}Expand description
Trait for building JavaScript options objects, providing convenience methods to construct an empty object and set (optionally nested) values on it in a builder style.
Provided Methods§
Sourcefn initialize(self) -> Selfwhere
Self: JsCast,
fn initialize(self) -> Selfwhere
Self: JsCast,
Hook for initializing a freshly constructed options object. The
default implementation returns self unchanged; implementors may
override it to set default values.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".