pub enum AllocMessageFormat {
AllocText(String),
Placeholder(usize),
}Expand description
Represents a format for an allocatable message, which can be either text or a placeholder.
§Examples
use local_fmt::AllocMessageFormat;
let text_format = AllocMessageFormat::AllocText(String::from("Hello"));
let placeholder_format = AllocMessageFormat::Placeholder(0);
assert_eq!(format!("{}", text_format), "Hello");
assert_eq!(format!("{}", placeholder_format), "{0}");Variants§
Trait Implementations§
Source§impl Clone for AllocMessageFormat
impl Clone for AllocMessageFormat
Source§fn clone(&self) -> AllocMessageFormat
fn clone(&self) -> AllocMessageFormat
Returns a duplicate of the value. Read more
1.0.0 · 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 AllocMessageFormat
impl Debug for AllocMessageFormat
Source§impl Display for AllocMessageFormat
impl Display for AllocMessageFormat
Source§impl Hash for AllocMessageFormat
impl Hash for AllocMessageFormat
Source§impl Ord for AllocMessageFormat
impl Ord for AllocMessageFormat
Source§fn cmp(&self, other: &AllocMessageFormat) -> Ordering
fn cmp(&self, other: &AllocMessageFormat) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for AllocMessageFormat
impl PartialEq for AllocMessageFormat
Source§impl PartialOrd for AllocMessageFormat
impl PartialOrd for AllocMessageFormat
impl Eq for AllocMessageFormat
impl StructuralPartialEq for AllocMessageFormat
Auto Trait Implementations§
impl Freeze for AllocMessageFormat
impl RefUnwindSafe for AllocMessageFormat
impl Send for AllocMessageFormat
impl Sync for AllocMessageFormat
impl Unpin for AllocMessageFormat
impl UnwindSafe for AllocMessageFormat
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