#[non_exhaustive]pub struct ParseCatalogOptions<'a> {
pub content: &'a str,
pub locale: Option<&'a str>,
pub source_locale: &'a str,
pub mode: CatalogMode,
pub strict: bool,
}Available on crate feature
catalog only.Expand description
Options for parsing a catalog into the higher-level message model.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.content: &'a strCatalog content to parse.
locale: Option<&'a str>Optional explicit locale override.
source_locale: &'a strSource locale used for source-side semantics and validation.
mode: CatalogModeHigh-level catalog mode used when interpreting catalog content.
strict: boolWhether unsupported ICU plural projection cases should become hard errors.
Implementations§
Source§impl<'a> ParseCatalogOptions<'a>
impl<'a> ParseCatalogOptions<'a>
Sourcepub fn new(content: &'a str, source_locale: &'a str) -> ParseCatalogOptions<'a>
pub fn new(content: &'a str, source_locale: &'a str) -> ParseCatalogOptions<'a>
Creates parse options with required fields set.
Optional fields default to an inferred locale, ICU-native PO mode, and non-strict plural projection.
Examples found in repository?
More examples
Sourcepub fn with_locale(self, locale: &'a str) -> ParseCatalogOptions<'a>
pub fn with_locale(self, locale: &'a str) -> ParseCatalogOptions<'a>
Returns options that use the given explicit catalog locale.
Examples found in repository?
More examples
Sourcepub fn with_mode(self, mode: CatalogMode) -> ParseCatalogOptions<'a>
pub fn with_mode(self, mode: CatalogMode) -> ParseCatalogOptions<'a>
Returns options that interpret catalog content with the given mode.
Sourcepub fn with_strict(self, strict: bool) -> ParseCatalogOptions<'a>
pub fn with_strict(self, strict: bool) -> ParseCatalogOptions<'a>
Returns options that enable or disable strict plural projection.
Trait Implementations§
Source§impl<'a> Clone for ParseCatalogOptions<'a>
impl<'a> Clone for ParseCatalogOptions<'a>
Source§fn clone(&self) -> ParseCatalogOptions<'a>
fn clone(&self) -> ParseCatalogOptions<'a>
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<'a> Debug for ParseCatalogOptions<'a>
impl<'a> Debug for ParseCatalogOptions<'a>
impl<'a> Eq for ParseCatalogOptions<'a>
Source§impl<'a> PartialEq for ParseCatalogOptions<'a>
impl<'a> PartialEq for ParseCatalogOptions<'a>
impl<'a> StructuralPartialEq for ParseCatalogOptions<'a>
Auto Trait Implementations§
impl<'a> Freeze for ParseCatalogOptions<'a>
impl<'a> RefUnwindSafe for ParseCatalogOptions<'a>
impl<'a> Send for ParseCatalogOptions<'a>
impl<'a> Sync for ParseCatalogOptions<'a>
impl<'a> Unpin for ParseCatalogOptions<'a>
impl<'a> UnsafeUnpin for ParseCatalogOptions<'a>
impl<'a> UnwindSafe for ParseCatalogOptions<'a>
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