pub enum LabelText<T> {
Localized(LocalizedString<T>),
Static(Static),
Dynamic(Dynamic<T>),
}
Expand description
The text for a Label
.
This can be one of three things; either an ArcStr
, a LocalizedString
,
or a closure with the signature Fn(&T, &Env) -> impl Into<ArcStr>
, where
T
is the Data
at this point in the tree.
Variants§
Localized(LocalizedString<T>)
Localized string that will be resolved through Env
.
Static(Static)
Static text.
Dynamic(Dynamic<T>)
The provided closure is called on update, and its return value is used as the text for the label.
Implementations§
Trait Implementations§
source§impl<T, S, F> From<F> for LabelText<T>where
S: Into<Arc<str>>,
F: Fn(&T, &Env) -> S + 'static,
impl<T, S, F> From<F> for LabelText<T>where S: Into<Arc<str>>, F: Fn(&T, &Env) -> S + 'static,
source§impl<T> From<LocalizedString<T>> for LabelText<T>
impl<T> From<LocalizedString<T>> for LabelText<T>
source§fn from(src: LocalizedString<T>) -> LabelText<T>
fn from(src: LocalizedString<T>) -> LabelText<T>
Converts to this type from the input type.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for LabelText<T>
impl<T> !Send for LabelText<T>
impl<T> !Sync for LabelText<T>
impl<T> Unpin for LabelText<T>
impl<T> !UnwindSafe for LabelText<T>
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
§impl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
§fn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,
§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.