pub struct Fallback(pub Option<Rc<dyn Fn() -> Element + 'static>>);Expand description
The fallback branch of a show-style conditional. Wraps an
optional Fn() -> Element closure — None means “render
nothing on false”; Some(closure) is what the user typed as
fallback: || ….
From<F: Fn() -> Element + 'static> lets a closure literal flow
through typed-builder’s Into<Fallback> path; Default (used
via #[prop(default)]) is None. (Fallback uses an
element-returning closure rather than Children’s
view-returning shape because the typical fallback is a single
component invocation like || render! { status_banner(...) },
which evaluates to Element. The implementation re-wraps it
into a View::Element before attaching.)
Tuple Fields§
§0: Option<Rc<dyn Fn() -> Element + 'static>>Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Fallback
impl !Send for Fallback
impl !Sync for Fallback
impl !UnwindSafe for Fallback
impl Freeze for Fallback
impl Unpin for Fallback
impl UnsafeUnpin for Fallback
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more