pub struct RustEmbedNotifyAssets<T: RustEmbed> { /* private fields */ }Expand description
A wrapper for rust_embed::RustEmbed that supports notifications when files have changed on
the file system. A wrapper is required to provide base_dir as this is unavailable in the type
derived by the rust_embed::RustEmbed macro.
⚠️ This type requires the following crate features to be activated: autoreload.
Implementations§
Source§impl<T: RustEmbed> RustEmbedNotifyAssets<T>
impl<T: RustEmbed> RustEmbedNotifyAssets<T>
Sourcepub fn new(base_dir: impl Into<PathBuf>) -> Self
pub fn new(base_dir: impl Into<PathBuf>) -> Self
Construct a new RustEmbedNotifyAssets.
Trait Implementations§
Source§impl<T> I18nAssets for RustEmbedNotifyAssets<T>where
T: RustEmbed,
Available on crate feature autoreload only.
impl<T> I18nAssets for RustEmbedNotifyAssets<T>where
T: RustEmbed,
Available on crate feature
autoreload only.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.
Auto Trait Implementations§
impl<T> Freeze for RustEmbedNotifyAssets<T>
impl<T> RefUnwindSafe for RustEmbedNotifyAssets<T>where
T: RefUnwindSafe,
impl<T> Send for RustEmbedNotifyAssets<T>where
T: Send,
impl<T> Sync for RustEmbedNotifyAssets<T>where
T: Sync,
impl<T> Unpin for RustEmbedNotifyAssets<T>where
T: Unpin,
impl<T> UnwindSafe for RustEmbedNotifyAssets<T>where
T: UnwindSafe,
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