#[non_exhaustive]pub struct CompileCatalogOptions<'a> {
pub key_strategy: CompiledKeyStrategy,
pub source_fallback: bool,
pub source_locale: Option<&'a str>,
pub semantics: CatalogSemantics,
pub syntax_policy: IcuSyntaxPolicy,
}catalog only.Expand description
Options controlling runtime catalog compilation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.key_strategy: CompiledKeyStrategyBuilt-in strategy used to derive stable runtime keys.
source_fallback: boolWhether empty source-locale values should be filled from the source text.
source_locale: Option<&'a str>Source locale used when source_fallback is enabled.
semantics: CatalogSemanticsHigh-level semantics used by the input catalog set.
syntax_policy: IcuSyntaxPolicyICU syntax policy used to canonicalize message text and compiled keys.
Non-strict policies require CatalogSemantics::IcuNative; structured
gettext plural branch values are not ICU message patterns.
Implementations§
Source§impl<'a> CompileCatalogOptions<'a>
impl<'a> CompileCatalogOptions<'a>
Sourcepub fn new() -> CompileCatalogOptions<'a>
pub fn new() -> CompileCatalogOptions<'a>
Creates runtime catalog compile options with default behavior.
Sourcepub fn with_key_strategy(
self,
key_strategy: CompiledKeyStrategy,
) -> CompileCatalogOptions<'a>
pub fn with_key_strategy( self, key_strategy: CompiledKeyStrategy, ) -> CompileCatalogOptions<'a>
Returns options that derive runtime keys with the given strategy.
Sourcepub fn with_source_fallback(
self,
source_fallback: bool,
) -> CompileCatalogOptions<'a>
pub fn with_source_fallback( self, source_fallback: bool, ) -> CompileCatalogOptions<'a>
Returns options that enable or disable source-locale fallback.
Sourcepub fn with_source_locale(
self,
source_locale: &'a str,
) -> CompileCatalogOptions<'a>
pub fn with_source_locale( self, source_locale: &'a str, ) -> CompileCatalogOptions<'a>
Returns options that use the given source locale for source fallback.
Sourcepub fn with_semantics(
self,
semantics: CatalogSemantics,
) -> CompileCatalogOptions<'a>
pub fn with_semantics( self, semantics: CatalogSemantics, ) -> CompileCatalogOptions<'a>
Returns options that interpret input catalogs with the given semantics.
Sourcepub fn with_syntax_policy(
self,
syntax_policy: IcuSyntaxPolicy,
) -> CompileCatalogOptions<'a>
pub fn with_syntax_policy( self, syntax_policy: IcuSyntaxPolicy, ) -> CompileCatalogOptions<'a>
Returns options that canonicalize ICU message text and keys with the given policy.
Trait Implementations§
Source§impl<'a> Clone for CompileCatalogOptions<'a>
impl<'a> Clone for CompileCatalogOptions<'a>
Source§fn clone(&self) -> CompileCatalogOptions<'a>
fn clone(&self) -> CompileCatalogOptions<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more