pub struct WhenInfo {
pub inputs: Box<[WhenInput]>,
pub state: BoxedVar<bool>,
pub assigns: Vec<Box<dyn PropertyArgs>>,
pub build_action_data: Vec<((PropertyId, &'static str), WhenBuildAction)>,
pub expr: &'static str,
pub location: SourceLocation,
}
Expand description
Represents a when
block in a widget.
Fields§
§inputs: Box<[WhenInput]>
Properties referenced in the when condition expression.
They are type erased BoxedVar<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: BoxedVar<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.
build_action_data: Vec<((PropertyId, &'static str), WhenBuildAction)>
Data associated with the when condition in the build action.
expr: &'static str
The condition expression code.
location: SourceLocation
When 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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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