pub struct CustomElementResult {
pub constructor: GeneratedConstructor,
pub closure: Closure<dyn FnMut(JsValue, Array) -> JsValue>,
}
Expand description
The result of creating a custom element.
Fields§
§constructor: GeneratedConstructor
The CustomElementResult
.constructor is the generated
class for your custom element.
closure: Closure<dyn FnMut(JsValue, Array) -> JsValue>
The returned CustomElementResult
.closure contains
the function you gave. It must be held in memory, or else the JS
side will error when trying to call the callback.
To have the closure live indefinitely (probably the
behavior you want), you can just call closure.forget()
.
Auto Trait Implementations§
impl Freeze for CustomElementResult
impl !RefUnwindSafe for CustomElementResult
impl !Send for CustomElementResult
impl !Sync for CustomElementResult
impl Unpin for CustomElementResult
impl !UnwindSafe for CustomElementResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more