pub struct EmbeddedMiniCdn { /* private fields */ }Expand description
A collection of files loaded from the compiled binary.
Implementations§
Source§impl EmbeddedMiniCdn
impl EmbeddedMiniCdn
Sourcepub fn new(root_path: &str) -> EmbeddedMiniCdn
pub fn new(root_path: &str) -> EmbeddedMiniCdn
Embeds the files into the binary at runtime, without compressing. The path is evaluated at runtime.
Sourcepub fn new_compressed(root_path: &str) -> EmbeddedMiniCdn
pub fn new_compressed(root_path: &str) -> EmbeddedMiniCdn
Embeds the files into the binary at runtime. The path and compression are evaluated at runtime. This may incur significant runtime latency.
Sourcepub fn get(&self, path: &str) -> Option<&MiniCdnFile>
pub fn get(&self, path: &str) -> Option<&MiniCdnFile>
Gets a previously embedded or inserted file.
Sourcepub fn insert(&mut self, path: Cow<'static, str>, file: MiniCdnFile)
pub fn insert(&mut self, path: Cow<'static, str>, file: MiniCdnFile)
Inserts a file.
Trait Implementations§
Source§impl Clone for EmbeddedMiniCdn
impl Clone for EmbeddedMiniCdn
Source§fn clone(&self) -> EmbeddedMiniCdn
fn clone(&self) -> EmbeddedMiniCdn
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EmbeddedMiniCdn
impl Debug for EmbeddedMiniCdn
Source§impl Default for EmbeddedMiniCdn
impl Default for EmbeddedMiniCdn
Source§fn default() -> EmbeddedMiniCdn
fn default() -> EmbeddedMiniCdn
Returns the “default value” for a type. Read more
Source§impl From<&FilesystemMiniCdn> for EmbeddedMiniCdn
impl From<&FilesystemMiniCdn> for EmbeddedMiniCdn
Source§fn from(filesystem: &FilesystemMiniCdn) -> EmbeddedMiniCdn
fn from(filesystem: &FilesystemMiniCdn) -> EmbeddedMiniCdn
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for EmbeddedMiniCdn
impl RefUnwindSafe for EmbeddedMiniCdn
impl Send for EmbeddedMiniCdn
impl Sync for EmbeddedMiniCdn
impl Unpin for EmbeddedMiniCdn
impl UnwindSafe for EmbeddedMiniCdn
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