#[non_exhaustive]pub struct WhenInfo {
pub inputs: Box<[WhenInput]>,
pub state: Var<bool>,
pub assigns: Vec<Box<dyn PropertyArgs>>,
pub attributes_data: Vec<((PropertyId, &'static str), PropertyAttributeWhen)>,
pub expr: &'static str,
pub location: SourceLocation,
}Expand description
Represents a when block in a widget.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.inputs: Box<[WhenInput]>Properties referenced in the when condition expression.
They are type erased Var<T> instances that are late-inited, other variable references (*#{var}) are embedded in
the build expression and cannot be modified. Note that the state sticks to the first late-inited vars that it uses,
the variable only updates after clone, this cloning happens naturally when instantiating a widget more then once.
state: Var<bool>Output of the when expression.
Panics if used outside of the widget context.
assigns: Vec<Box<dyn PropertyArgs>>Properties assigned in the when block, in the build widget they are joined with the default value and assigns
from other when blocks into a single property instance set to when_var! inputs.
attributes_data: Vec<((PropertyId, &'static str), PropertyAttributeWhen)>Data associated with the when condition in the attribute.
expr: &'static strThe condition expression code.
location: SourceLocationWhen declaration location.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WhenInfo
impl !RefUnwindSafe for WhenInfo
impl Send for WhenInfo
impl Sync for WhenInfo
impl !Unpin for WhenInfo
impl !UnwindSafe for WhenInfo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
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>
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