Expand description
DOM injection utilities, allowing injection of script and style
elements from Rust buffers using Blob
objects.
This can be used in conjunction with include_bytes macro to embed
JavaScript scripts, modules and CSS stylesheets directly within WASM
binary.
Enums§
- Content
- The Content enum specifies the type of the content being injected
Each enum variant contains optional content
idand&[u8]data.
Functions§
- inject_
blob - Inject a
Blobinto DOM. Thecontentargument carries the data buffer and the content type represented by theContentstruct. This function returns a future that completes upon injection completion. - inject_
blob_ nowait - Inject a
Blobinto DOM. Thecontentargument carries the data buffer and the content type represented by theContentstruct. - inject_
blob_ with_ callback - Inject data buffer contained in the
Contentstruct as aBlobinto DOM. Executes an optionalloadcallback when the loading is complete. The load callback receivesweb_sys::CustomEventstruct indicating the load result. - inject_
css - Inject CSS stylesheed directly into DOM as a
<style>element usingElement::set_inner_html - inject_
script - Inject script as a
Blobbuffer into DOM. Executes an optionalloadcallback when the loading is complete. The load callback receivesweb_sys::CustomEventstruct indicating the load result. - inject_
stylesheet