Skip to main content

Widget

Trait Widget 

Source
pub trait Widget: 'static {
    // Provided method
    fn key(&self) -> Option<&dyn Key> { ... }
}
Expand description

Base contract shared by stateless and stateful widget descriptions.

Core deliberately does not prescribe how a widget is mounted, laid out, or painted. Higher-level crates can add those concerns while still accepting any type implementing this identity contract. The default key is absent, which gives a widget positional identity in a local reconciliation pass.

Provided Methods§

Source

fn key(&self) -> Option<&dyn Key>

Returns the optional local identity used by reconciliation.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§