Skip to main content

CustomElementMetadata

Trait CustomElementMetadata 

Source
pub trait CustomElementMetadata {
    const CUSTOM_ELEMENT_NAME: &'static str;
    const STATICS: &'static [&'static str] = _;
    const TYPE_NAME: &'static str = _;

    // Provided method
    fn struct_name() -> &'static str { ... }
}
Expand description

A trait which allows the define_web_component method to create a Custom Element (which must by definition inherit from HTMLElement) from a [wasm_bindgen] annotated Rust struct (for which this trait is implemented).

Required Associated Constants§

Source

const CUSTOM_ELEMENT_NAME: &'static str

The name of the element to register.

Provided Associated Constants§

Source

const STATICS: &'static [&'static str] = _

[optional] The names of the methods which should be static on the element.

Source

const TYPE_NAME: &'static str = _

[optional] The name of the Rust struct.

Provided Methods§

Source

fn struct_name() -> &'static str

[optional] A custom implementation of struct name to class name.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl CustomElementMetadata for CopyDropDownMenuElement

Source§

const CUSTOM_ELEMENT_NAME: &'static str = "perspective-copy-menu"

Source§

impl CustomElementMetadata for PerspectiveDebugPluginElement

Source§

const CUSTOM_ELEMENT_NAME: &'static str = "perspective-viewer-plugin"

Source§

impl CustomElementMetadata for ExportDropDownMenuElement

Source§

const CUSTOM_ELEMENT_NAME: &'static str = "perspective-export-menu"

Source§

impl CustomElementMetadata for PerspectiveViewerElement

Source§

const CUSTOM_ELEMENT_NAME: &'static str = "perspective-viewer"

Source§

const STATICS: &'static [&'static str]