Struct minicdn::EmbeddedMiniCdn
source · [−]pub struct EmbeddedMiniCdn { /* private fields */ }Expand description
A collection of files loaded from the compiled binary.
Implementations
sourceimpl 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<Cow<'_, MiniCdnFile>>
pub fn get(&self, path: &str) -> Option<Cow<'_, 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
sourceimpl Clone for EmbeddedMiniCdn
impl Clone for EmbeddedMiniCdn
sourcefn clone(&self) -> EmbeddedMiniCdn
fn clone(&self) -> EmbeddedMiniCdn
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Default for EmbeddedMiniCdn
impl Default for EmbeddedMiniCdn
sourcefn default() -> EmbeddedMiniCdn
fn default() -> EmbeddedMiniCdn
Returns the “default value” for a type. Read more
sourceimpl<'_> From<&FilesystemMiniCdn> for EmbeddedMiniCdn
impl<'_> From<&FilesystemMiniCdn> for EmbeddedMiniCdn
sourcefn from(filesystem: &FilesystemMiniCdn) -> EmbeddedMiniCdn
fn from(filesystem: &FilesystemMiniCdn) -> EmbeddedMiniCdn
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for EmbeddedMiniCdn
impl Send for EmbeddedMiniCdn
impl Sync for EmbeddedMiniCdn
impl Unpin for EmbeddedMiniCdn
impl UnwindSafe for EmbeddedMiniCdn
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<R, P> ReadPrimitive<R> for P where
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for P where
R: Read + ReadEndian<P>,
P: Default,
sourcefn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
sourcefn read_from_big_endian(read: &mut R) -> Result<Self, Error>
fn read_from_big_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
sourcefn read_from_native_endian(read: &mut R) -> Result<Self, Error>
fn read_from_native_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().