pub enum LocalizedText {
Plain(String),
PerLocale(BTreeMap<String, String>),
}Expand description
A piece of human-facing text a profile supplies, either one string for every locale or a per-locale map.
Used for the messages a profile localizes for the dashboard - its custom discrete state codes and event codes. In a manifest it is a bare string for the simple case or an object keyed by locale tag:
{ "state.flushing": "Flushing", "event.filter_clog": { "en": "Filter clogged", "sw": "Kichujio kimeziba" } }Variants§
Plain(String)
One text shown in every locale that has no specific translation.
PerLocale(BTreeMap<String, String>)
Per-locale text, keyed by locale tag ("en", "sw", …).
Trait Implementations§
Source§impl Clone for LocalizedText
impl Clone for LocalizedText
Source§fn clone(&self) -> LocalizedText
fn clone(&self) -> LocalizedText
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 LocalizedText
impl Debug for LocalizedText
Source§impl<'de> Deserialize<'de> for LocalizedText
impl<'de> Deserialize<'de> for LocalizedText
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for LocalizedText
Source§impl From<&str> for LocalizedText
impl From<&str> for LocalizedText
Source§impl From<String> for LocalizedText
impl From<String> for LocalizedText
Source§impl PartialEq for LocalizedText
impl PartialEq for LocalizedText
Source§fn eq(&self, other: &LocalizedText) -> bool
fn eq(&self, other: &LocalizedText) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for LocalizedText
impl Serialize for LocalizedText
impl StructuralPartialEq for LocalizedText
Auto Trait Implementations§
impl Freeze for LocalizedText
impl RefUnwindSafe for LocalizedText
impl Send for LocalizedText
impl Sync for LocalizedText
impl Unpin for LocalizedText
impl UnsafeUnpin for LocalizedText
impl UnwindSafe for LocalizedText
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