Skip to content

struct

Registry

pub struct Registry {
    /* private fields */
}

Components available to templates by name.

Methods

new

pub fn new() -> Registry

An empty registry. weft::ui::registry() gives one with every built-in component.

register

pub fn register(&mut self, component: Component)

Add component, replacing any of the same name.

with

pub fn with(self, component: Component) -> Registry

Builder form of [Registry::register].

get

pub fn get(&self, name: &str) -> Option<&Component>

The component called name, if registered.

names

pub fn names(&self) -> Vec<String>

Every registered component's name, sorted.

Trait implementations