Skip to main content

WhenBuilder

Trait WhenBuilder 

Source
pub trait WhenBuilder: Sized {
    // Required method
    fn otherwise<P: Piece>(self, build_arm: impl Fn() -> P + 'static) -> Self;
}
Expand description

Builder methods of When, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.

Required Methods§

Source

fn otherwise<P: Piece>(self, build_arm: impl Fn() -> P + 'static) -> Self

The arm built while the condition is false. Without it, false means “no subtree”.

The two arms need not return the same Piece type; each is erased to AnyPiece here. Exactly one arm is mounted at a time, in its own child scope, so flipping disposes the outgoing arm’s signals, bindings, and handlers before the incoming arm builds (§4.3).

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl WhenBuilder for When

Source§

impl<DecoratedInner: WhenBuilder + Piece> WhenBuilder for Decorated<DecoratedInner>

Day API ↩ Guides· daybrite.dev