pub struct UIString(/* private fields */);Expand description
A concrete type that represents a string that can be displayed on screen.
Most widgets will accept an impl Into<UIString> parameter to receive the text that they should display.
Into<UIString> has been implemented for:
&'static str,String,LocalizedStringWeakVar<T>whereTis:
&'static str, String, f32, f64, bool, char, usize, isize,
u8, u16, u32, u64, u128,
i8, i16, i32, i64, i128,
NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64,
NonZeroU128, NonZeroI8, NonZeroI16, NonZeroI32,
NonZeroI64, or NonZeroI128.
Every type except &'static str and String will automatically update the screen when changed.
The ui_format macro can be used to create a UIString from a value using a custom format string.
Implementations§
Source§impl UIString
impl UIString
Sourcepub fn deferred<F>(f: F) -> Self
pub fn deferred<F>(f: F) -> Self
Creates a UIString that is computed later during UIString::resolve.
Sourcepub fn resolve<'a>(
&'a self,
translation_map: &'a TranslationMap,
) -> Option<UIStringRef<'a>>
pub fn resolve<'a>( &'a self, translation_map: &'a TranslationMap, ) -> Option<UIStringRef<'a>>
Resolves the string to a type that derefs to &str.
This keeps the underlying lock active for the lifetime of the returned UIStringRef.