pub trait Piece: 'static {
// Required method
fn build(self, cx: &mut BuildCx) -> RNode;
}Expand description
A UI description consumed once (§5.2). Returns the root realized node it created.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<P: Piece> Piece for Option<P>
An optional piece (§5.1): Some builds the piece, None builds the same zero-size,
layout-transparent anchor a false when leaves behind, so
the slot keeps its place in a tuple without drawing anything.
impl<P: Piece> Piece for Option<P>
An optional piece (§5.1): Some builds the piece, None builds the same zero-size,
layout-transparent anchor a false when leaves behind, so
the slot keeps its place in a tuple without drawing anything.
ⓘ
let precip = (d.precip > 0).then(|| label(format!("{}%", d.precip)));
row((icon, precip))Resolved once at build. For an Option that changes while the piece lives, use
keyed(move || state.get(), |v| …).