pub struct CatalogMessageKey {
pub msgid: String,
pub msgctxt: Option<String>,
}Available on crate feature
catalog only.Expand description
Stable lookup key for catalog messages.
Fields§
§msgid: StringSource message identifier.
msgctxt: Option<String>Optional gettext message context.
Implementations§
Source§impl CatalogMessageKey
impl CatalogMessageKey
Sourcepub fn new(msgid: impl Into<String>, msgctxt: Option<String>) -> Self
pub fn new(msgid: impl Into<String>, msgctxt: Option<String>) -> Self
Creates a message key from msgid and optional context.
Sourcepub fn with_context(
msgid: impl Into<String>,
msgctxt: impl Into<String>,
) -> Self
pub fn with_context( msgid: impl Into<String>, msgctxt: impl Into<String>, ) -> Self
Creates a message key from msgid and context.
This is equivalent to CatalogMessageKey::new(msgid, Some(msgctxt.into()))
but lets callers pass borrowed context strings without spelling the
intermediate Some(String).
Trait Implementations§
Source§impl Clone for CatalogMessageKey
impl Clone for CatalogMessageKey
Source§fn clone(&self) -> CatalogMessageKey
fn clone(&self) -> CatalogMessageKey
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 CatalogMessageKey
impl Debug for CatalogMessageKey
Source§impl<'de> Deserialize<'de> for CatalogMessageKey
impl<'de> Deserialize<'de> for CatalogMessageKey
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 CatalogMessageKey
Source§impl Hash for CatalogMessageKey
impl Hash for CatalogMessageKey
Source§impl Ord for CatalogMessageKey
impl Ord for CatalogMessageKey
Source§fn cmp(&self, other: &CatalogMessageKey) -> Ordering
fn cmp(&self, other: &CatalogMessageKey) -> Ordering
1.21.0 (const: unstable) · 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 CatalogMessageKey
impl PartialEq for CatalogMessageKey
Source§fn eq(&self, other: &CatalogMessageKey) -> bool
fn eq(&self, other: &CatalogMessageKey) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for CatalogMessageKey
impl PartialOrd for CatalogMessageKey
Source§impl Serialize for CatalogMessageKey
impl Serialize for CatalogMessageKey
impl StructuralPartialEq for CatalogMessageKey
Auto Trait Implementations§
impl Freeze for CatalogMessageKey
impl RefUnwindSafe for CatalogMessageKey
impl Send for CatalogMessageKey
impl Sync for CatalogMessageKey
impl Unpin for CatalogMessageKey
impl UnsafeUnpin for CatalogMessageKey
impl UnwindSafe for CatalogMessageKey
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