pub struct LocalizedStringBuilder { /* private fields */ }Expand description
Used to construct a LocalizedString
Implementations§
Source§impl LocalizedStringBuilder
impl LocalizedStringBuilder
Sourcepub fn new(key: &'static str) -> Self
pub fn new(key: &'static str) -> Self
Creates a new builder. key is used to look up translations in a TranslationFile.
Sourcepub fn placeholder(self, text: &'static str) -> Self
pub fn placeholder(self, text: &'static str) -> Self
Provides a placeholder string to display when resolving fails.
Sourcepub fn arg(self, key: &'static str, value: impl Into<LocalizedArg>) -> Self
pub fn arg(self, key: &'static str, value: impl Into<LocalizedArg>) -> Self
Adds a value to be used as a localization argument when resolving the string. This can be a static value or a reactive variable.
Sourcepub fn build(self) -> LocalizedString
pub fn build(self) -> LocalizedString
Builds the LocalizedString.
Auto Trait Implementations§
impl !RefUnwindSafe for LocalizedStringBuilder
impl !UnwindSafe for LocalizedStringBuilder
impl Freeze for LocalizedStringBuilder
impl Send for LocalizedStringBuilder
impl Sync for LocalizedStringBuilder
impl Unpin for LocalizedStringBuilder
impl UnsafeUnpin for LocalizedStringBuilder
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
Mutably borrows from an owned value. Read more