AssetsMultiplexor

Struct AssetsMultiplexor 

Source
pub struct AssetsMultiplexor { /* private fields */ }
Expand description

A way to multiplex implementations of I18nAssets.

Implementations§

Source§

impl AssetsMultiplexor

Source

pub fn new( assets: impl IntoIterator<Item = Box<dyn I18nAssets + Send + Sync + 'static>>, ) -> Self

Construct a new AssetsMultiplexor. assets are specified in order of priority of processing for the crate::LanguageLoader.

Trait Implementations§

Source§

impl Debug for AssetsMultiplexor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl I18nAssets for AssetsMultiplexor

Source§

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> + '_>

Get an iterator over the file paths of the localization assets. There may be duplicates where multiple files exist for the same file path.
Source§

fn subscribe_changed( &self, changed: Arc<dyn Fn() + Send + Sync + 'static>, ) -> Result<Box<dyn Watcher + Send + Sync + 'static>, I18nEmbedError>

A method to allow users of this trait to subscribe to change events, and reload assets when they have changed. The subscription will be cancelled when the returned Watcher is dropped. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.