Struct zng_app::widget::node::WhenUiNodeListBuilder
source · pub struct WhenUiNodeListBuilder { /* private fields */ }
Expand description
Builds a node list that can be one of multiple options, selected by the first condition that is true
, or a fallback default.
When the selected list changes the previous one is deinited and the new one is inited.
Implementations§
source§impl WhenUiNodeListBuilder
impl WhenUiNodeListBuilder
sourcepub fn new(default: impl UiNodeList) -> Self
pub fn new(default: impl UiNodeList) -> Self
New with list that is used when no condition is active.
sourcepub fn push(&mut self, condition: impl Var<bool>, list: impl UiNodeList)
pub fn push(&mut self, condition: impl Var<bool>, list: impl UiNodeList)
Push a conditional list.
When condition
is true
and no previous inserted condition is true
the list
is used.
sourcepub fn build(self) -> impl UiNodeList
pub fn build(self) -> impl UiNodeList
Build a list that is always the first true
condition or the default.
Auto Trait Implementations§
impl Freeze for WhenUiNodeListBuilder
impl !RefUnwindSafe for WhenUiNodeListBuilder
impl Send for WhenUiNodeListBuilder
impl !Sync for WhenUiNodeListBuilder
impl Unpin for WhenUiNodeListBuilder
impl !UnwindSafe for WhenUiNodeListBuilder
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more