pub struct DeferredMessage { /* private fields */ }Expand description
A message captured outside composition and translated when displayed.
Borrowed arguments become owned; cloning a request shares their storage.
Use message! to construct one with checked source text and named arguments.
Implementations§
Source§impl DeferredMessage
impl DeferredMessage
Sourcepub fn new<const N: usize>(
message: &'static Message,
arguments: [Argument<'_>; N],
) -> DeferredMessage
pub fn new<const N: usize>( message: &'static Message, arguments: [Argument<'_>; N], ) -> DeferredMessage
Captures arguments for a checked static message without formatting it.
Sourcepub fn format(
&self,
translator: Option<&Translator>,
) -> Result<String, LocalizationError>
pub fn format( &self, translator: Option<&Translator>, ) -> Result<String, LocalizationError>
Formats with the current application translator, or the source language.
Sourcepub fn fallback_text(&self) -> String
pub fn fallback_text(&self) -> String
Readable source text when a malformed runtime catalog cannot be formatted.
Trait Implementations§
Source§impl Clone for DeferredMessage
impl Clone for DeferredMessage
Source§fn clone(&self) -> DeferredMessage
fn clone(&self) -> DeferredMessage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DeferredMessage
impl Debug for DeferredMessage
Source§impl From<DeferredMessage> for UiText
impl From<DeferredMessage> for UiText
Source§fn from(message: DeferredMessage) -> Self
fn from(message: DeferredMessage) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for DeferredMessage
impl !Send for DeferredMessage
impl !Sync for DeferredMessage
impl !UnwindSafe for DeferredMessage
impl Freeze for DeferredMessage
impl Unpin for DeferredMessage
impl UnsafeUnpin for DeferredMessage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
Converts
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> ⓘ
Converts
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