pub enum MiniCdn {
Embedded(EmbeddedMiniCdn),
Filesystem(FilesystemMiniCdn),
}Expand description
A collection of files, either loaded from the compiled binary or the filesystem at runtime.
Variants§
Embedded(EmbeddedMiniCdn)
Filesystem(FilesystemMiniCdn)
Implementations§
Source§impl MiniCdn
impl MiniCdn
Sourcepub fn new_embedded_from_path(root_path: &str) -> MiniCdn
pub fn new_embedded_from_path(root_path: &str) -> MiniCdn
Embeds the files into the binary at runtime, without compressing. The path is evaluated at runtime.
Sourcepub fn new_compressed_from_path(root_path: &str) -> MiniCdn
pub fn new_compressed_from_path(root_path: &str) -> MiniCdn
Embeds the files into the binary at runtime. The path and compression are evaluated at runtime. This may incur significant runtime latency.
Sourcepub fn new_filesystem_from_path(root_path: Cow<'static, str>) -> MiniCdn
pub fn new_filesystem_from_path(root_path: Cow<'static, str>) -> MiniCdn
References the files. Subsequent accesses will load from the file system relative to this path.
Sourcepub fn insert(&mut self, path: Cow<'static, str>, file: MiniCdnFile)
pub fn insert(&mut self, path: Cow<'static, str>, file: MiniCdnFile)
Insert a new file. Will convert to embedded mode if needed.
Sourcepub fn for_each(&self, f: impl FnMut(&str, &MiniCdnFile))
pub fn for_each(&self, f: impl FnMut(&str, &MiniCdnFile))
Apply a function to each file.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MiniCdn
impl RefUnwindSafe for MiniCdn
impl Send for MiniCdn
impl Sync for MiniCdn
impl Unpin for MiniCdn
impl UnwindSafe for MiniCdn
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