pub trait DynamicComponent: Any + Debug + Send + Sync + UnwindSafe + RefUnwindSafe + 'static {
    // Required method
    fn name(&self) -> Name;

    // Provided methods
    fn inherited(&self) -> bool { ... }
    fn merge(&mut self, other: &Self) { ... }
}
Expand description

A style component that can be powered by data contained in the structure.

This trait allows style components to be defined that didn’t originate from Rust code – e.g., a scripting language.

Required Methods§

source

fn name(&self) -> Name

The unique name of this style component.

Each name component must be a valid identifier: a-z, A-Z, or _.

The Name is namespaced. If this trait is implemented for a type that is distributed as part of a crate, the implementation should use a unique authority based on the crate it comes from.

Provided Methods§

source

fn inherited(&self) -> bool

Returns whether the component should be inherited. Affects the behavior of Style::inherited_from

source

fn merge(&mut self, other: &Self)

Merges self with other, if it makes sense to do so for this type. The default implementation does not do anything, preserving the value in self.

Implementors§