[−][src]Enum druid::widget::LabelText
The text for the label
Variants
Localized(LocalizedString<T>)
Localized string that will be resolved through Env
.
Specific(String)
Specific text
The provided closure is called on update, and its return value is used as the text for the label.
Methods
impl<T: Data> LabelText<T>
[src]
pub fn with_display_text<V>(
&self,
data: &T,
env: &Env,
cb: impl FnMut(&str) -> V
) -> V
[src]
&self,
data: &T,
env: &Env,
cb: impl FnMut(&str) -> V
) -> V
Call callback with the text that should be displayed.
pub fn resolve(&mut self, data: &T, env: &Env) -> bool
[src]
Update the localization, if necessary. This ensures that localized strings are up to date.
Returns true
if the string has changed.
Trait Implementations
impl<'_, T> From<&'_ str> for LabelText<T>
[src]
impl<T, F: Fn(&T, &Env) -> String + 'static> From<F> for LabelText<T>
[src]
impl<T> From<LocalizedString<T>> for LabelText<T>
[src]
fn from(src: LocalizedString<T>) -> LabelText<T>
[src]
impl<T> From<String> for LabelText<T>
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> RoundFrom<T> for T
fn round_from(x: T) -> T
impl<T, U> RoundInto<U> for T where
U: RoundFrom<T>,
U: RoundFrom<T>,
fn round_into(self) -> U
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,