pub struct Features { /* private fields */ }Expand description
Which functions the built catalogs may use, and which locale data they need.
Implementations§
Source§impl Features
impl Features
Sourcepub fn from_env() -> Features
pub fn from_env() -> Features
The set cargo passed this build.rs: every CARGO_FEATURE_* in the
environment, back in its kebab-case spelling.
Cargo spells a feature some-feature as CARGO_FEATURE_SOME_FEATURE,
so a feature whose name already holds _ comes back with -. None of
the facade’s features does (plans/00-master-plan.md §5).
Sourcepub fn from_vars(vars: impl IntoIterator<Item = (String, String)>) -> Features
pub fn from_vars(vars: impl IntoIterator<Item = (String, String)>) -> Features
Features::from_env over a given environment, for tests.
Sourcepub fn parse(list: &str) -> Features
pub fn parse(list: &str) -> Features
The set a --features argument names: comma- or space-separated, with
crate/feature reduced to feature as cargo reads it.
Sourcepub fn from_names<S: Into<String>>(
names: impl IntoIterator<Item = S>,
) -> Features
pub fn from_names<S: Into<String>>( names: impl IntoIterator<Item = S>, ) -> Features
A set from names, for tests and mf2 compile.
Sourcepub fn for_catalogs(&self) -> Features
pub fn for_catalogs(&self) -> Features
Only the [CATALOG_FEATURES] of this set: what mf2 compile --site
compares with the i18n crate’s.
Sourcepub fn fn_number(&self) -> bool
pub fn fn_number(&self) -> bool
Number localization: symbols, grouping, numbering systems, and
:percent / :currency / :unit.
Sourcepub fn fn_datetime(&self) -> bool
pub fn fn_datetime(&self) -> bool
The date and time family.
Sourcepub fn datetime_icu(&self) -> bool
pub fn datetime_icu(&self) -> bool
Dates over ICU4X, from the catalog’s icu.blob.
Sourcepub fn datetime_intl(&self) -> bool
pub fn datetime_intl(&self) -> bool
Dates over the browser’s Intl.DateTimeFormat.
Sourcepub fn intl(&self) -> bool
pub fn intl(&self) -> bool
Numbers, plural selection and dates through the browser’s Intl on
the client (D4). The server keeps the Rust path, so a catalog still
carries the data unless the build writes a client variant.
Sourcepub fn provides(&self, identifier: &str) -> Option<bool>
pub fn provides(&self, identifier: &str) -> Option<bool>
Whether this build provides the built-in function identifier (an
MF2 identifier without its :), or None if it is not a built-in —
a custom function, which [functions] in mf2.toml answers for.
Sourcepub fn missing_feature(&self, identifier: &str) -> Option<&'static str>
pub fn missing_feature(&self, identifier: &str) -> Option<&'static str>
The feature identifier needs and this build does not have.
Trait Implementations§
impl Eq for Features
impl StructuralPartialEq for Features
Auto Trait Implementations§
impl Freeze for Features
impl RefUnwindSafe for Features
impl Send for Features
impl Sync for Features
impl Unpin for Features
impl UnsafeUnpin for Features
impl UnwindSafe for Features
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more