pub struct Localizations;Expand description
Embedded Fluent resources shipped with the crate.
The struct implements RustEmbed, allowing callers to seed a
FluentLanguageLoader with the bundled locale files.
§Examples
let mut loader = fluent_language_loader!();
let selected = i18n_embed::select(&loader, &Localizations, &[langid!("en-US")]).unwrap();
assert!(selected.contains(&langid!("en-US")));Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Localizations
impl RefUnwindSafe for Localizations
impl Send for Localizations
impl Sync for Localizations
impl Unpin for Localizations
impl UnwindSafe for Localizations
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
Source§impl<T> I18nAssets for Twhere
T: RustEmbed,
impl<T> I18nAssets for Twhere
T: RustEmbed,
Source§fn get_files(&self, file_path: &str) -> Vec<Cow<'_, [u8]>>
fn get_files(&self, file_path: &str) -> Vec<Cow<'_, [u8]>>
Get localization asset files that correspond to the specified
file_path. Returns an empty
Vec if the asset does not exist, or unable to obtain the asset due to a non-critical
error.Source§fn filenames_iter(&self) -> Box<dyn Iterator<Item = String>>
fn filenames_iter(&self) -> Box<dyn Iterator<Item = String>>
Get an iterator over the file paths of the localization assets. There may be duplicates
where multiple files exist for the same file path.