Skip to main content

Piece

Trait Piece 

Source
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§

Source

fn build(self, cx: &mut BuildCx) -> RNode

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 for Option<P>
where P: Piece,

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| …).

Source§

fn build(self, cx: &mut BuildCx) -> RNode

Implementors§

Source§

impl Piece for AnyPiece

Source§

impl Piece for Button

Source§

impl Piece for ComposedSheet

Source§

impl Piece for Divider

Source§

impl Piece for Image

Source§

impl Piece for Label

Source§

impl Piece for ListItem

Source§

impl Piece for Progress

Source§

impl Piece for ShapePiece

Source§

impl Piece for Spacer

Source§

impl Piece for Split

Source§

impl Piece for Vector

Source§

impl Piece for When

Source§

impl<A, B> Piece for Either<A, B>
where A: Piece, B: Piece,

Source§

impl<C: PieceSeq + 'static> Piece for Form<C>

Source§

impl<C: PieceSeq + 'static> Piece for FormSection<C>

Source§

impl<C: PieceSeq> Piece for Adaptive<C>

Source§

impl<C: PieceSeq> Piece for Column<C>

Source§

impl<C: PieceSeq> Piece for Grid<C>

Source§

impl<C: PieceSeq> Piece for GridRow<C>

Source§

impl<C: PieceSeq> Piece for Row<C>

Source§

impl<C: PieceSeq> Piece for ZStack<C>

Source§

impl<F> Piece for PieceFn<F>
where F: FnOnce(&mut BuildCx) -> RNode + 'static,

Source§

impl<K: PartialEq + Clone + 'static> Piece for Keyed<K>

Source§

impl<K: Route, S: Binding<K>> Piece for Nav<S, K>

Source§

impl<K: Route, S: Binding<Vec<K>>> Piece for NavStack<S, K>

Source§

impl<K: Route> Piece for DocumentTabs<K>

Source§

impl<P: Piece> Piece for Decorated<P>

Source§

impl<P: Piece> Piece for Labeled<P>

Source§

impl<P: Piece> Piece for Scroll<P>

Source§

impl<S: Binding<Option<R>>, R: Route> Piece for Cover<S, R>

Source§

impl<S: Binding<String>> Piece for TextArea<S>

Source§

impl<S: Binding<String>> Piece for TextField<S>

Source§

impl<S: Binding<bool>> Piece for Toggle<S>

Source§

impl<S: Binding<f64>> Piece for Slider<S>

Source§

impl<S: NodeSource + 'static> Piece for TreePiece<S>

Source§

impl<S: RowSource + 'static> Piece for List<S>

Source§

impl<T: Clone + 'static> Piece for LoadPiece<T>

Source§

impl<T: Clone + PartialEq + 'static, S: PickerSelection<T>> Piece for Picker<T, S>

Source§

impl<V: Binding<bool>> Piece for Inspector<V>

Day API ↩ Guides· daybrite.dev