pub struct CatalogMessage {
pub msgid: String,
pub msgctxt: Option<String>,
pub translation: TranslationShape,
pub comments: Vec<String>,
pub origin: Vec<CatalogOrigin>,
pub obsolete: bool,
pub machine_translation: Option<MachineTranslationMetadata>,
pub extra: Option<CatalogMessageExtra>,
}Expand description
Public message representation returned by super::parse_catalog.
Fields§
§msgid: StringSource message identifier.
msgctxt: Option<String>Optional gettext message context.
translation: TranslationShapePublic translation representation.
comments: Vec<String>Extracted comments preserved from the source catalog.
origin: Vec<CatalogOrigin>Source origins preserved from PO references.
obsolete: boolWhether the message is marked obsolete.
machine_translation: Option<MachineTranslationMetadata>Optional machine-translation metadata for the current translation.
extra: Option<CatalogMessageExtra>Optional additional translator-facing PO metadata.
Implementations§
Source§impl CatalogMessage
impl CatalogMessage
Sourcepub fn key(&self) -> CatalogMessageKey
pub fn key(&self) -> CatalogMessageKey
Returns the lookup key for this message.
Sourcepub fn effective_translation(&self) -> EffectiveTranslationRef<'_>
pub fn effective_translation(&self) -> EffectiveTranslationRef<'_>
Returns the effective translation without source-locale fallback.
Trait Implementations§
Source§impl Clone for CatalogMessage
impl Clone for CatalogMessage
Source§fn clone(&self) -> CatalogMessage
fn clone(&self) -> CatalogMessage
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 CatalogMessage
impl Debug for CatalogMessage
Source§impl<'de> Deserialize<'de> for CatalogMessage
impl<'de> Deserialize<'de> for CatalogMessage
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CatalogMessage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CatalogMessage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for CatalogMessage
Source§impl PartialEq for CatalogMessage
impl PartialEq for CatalogMessage
Source§fn eq(&self, other: &CatalogMessage) -> bool
fn eq(&self, other: &CatalogMessage) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for CatalogMessage
impl Serialize for CatalogMessage
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for CatalogMessage
Auto Trait Implementations§
impl Freeze for CatalogMessage
impl RefUnwindSafe for CatalogMessage
impl Send for CatalogMessage
impl Sync for CatalogMessage
impl Unpin for CatalogMessage
impl UnsafeUnpin for CatalogMessage
impl UnwindSafe for CatalogMessage
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