Skip to main content

script

Trait script 

Source
pub trait script {
    const script: ElementBuilder<ScriptElement, (), ()>;
}
Expand description

Per-element trait carrying the element as an associated const on the shared html root, so html::#name resolves wherever this trait is in scope. Other vocabularies extend the same root the same way.

Required Associated Constants§

Source

const script: ElementBuilder<ScriptElement, (), ()>

Build a <script> element.

The script HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code. The script element can also be used with other languages, such as WebGL’s GLSL shader programming language and JSON.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§