Struct rust_embed_for_web::DynamicFile
source · pub struct DynamicFile { /* private fields */ }
Expand description
A file read from the file system dynamically.
rust-embed-for-web
changes which type of file you get based on whether
it’s a debug or release build. In debug builds, you’ll get DynamicFile
s.
You should interface with this object using the EmbedableFile
trait, which
is implemented for both the embedded and dynamic files.
Implementations
sourceimpl DynamicFile
impl DynamicFile
pub fn read_from_fs<P>(path: P) -> Result<DynamicFile, Error>where
P: AsRef<Path>,
Trait Implementations
sourceimpl Clone for DynamicFile
impl Clone for DynamicFile
sourcefn clone(&self) -> DynamicFile
fn clone(&self) -> DynamicFile
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 moresourceimpl Debug for DynamicFile
impl Debug for DynamicFile
sourceimpl EmbedableFile for DynamicFile
impl EmbedableFile for DynamicFile
type Data = Vec<u8, Global>
type Meta = String
sourcefn name(&self) -> <DynamicFile as EmbedableFile>::Meta
fn name(&self) -> <DynamicFile as EmbedableFile>::Meta
The name of the embedded file.
sourcefn data(&self) -> <DynamicFile as EmbedableFile>::Data
fn data(&self) -> <DynamicFile as EmbedableFile>::Data
The contents of the embedded file.
sourcefn data_gzip(&self) -> Option<<DynamicFile as EmbedableFile>::Data>
fn data_gzip(&self) -> Option<<DynamicFile as EmbedableFile>::Data>
The contents of the file, compressed with gzip. Read more
sourcefn data_br(&self) -> Option<<DynamicFile as EmbedableFile>::Data>
fn data_br(&self) -> Option<<DynamicFile as EmbedableFile>::Data>
The contents of the file, compressed with brotli. Read more
sourcefn last_modified(&self) -> Option<<DynamicFile as EmbedableFile>::Meta>
fn last_modified(&self) -> Option<<DynamicFile as EmbedableFile>::Meta>
The rfc2822 encoded last modified date. This is the format you use for
Last-Modified
headers. Read moresourcefn last_modified_timestamp(&self) -> Option<i64>
fn last_modified_timestamp(&self) -> Option<i64>
The UNIX timestamp of when the file was last modified.
sourcefn hash(&self) -> <DynamicFile as EmbedableFile>::Meta
fn hash(&self) -> <DynamicFile as EmbedableFile>::Meta
The hash value for the file. This is a base85 encoded sha256 hash.
sourcefn etag(&self) -> <DynamicFile as EmbedableFile>::Meta
fn etag(&self) -> <DynamicFile as EmbedableFile>::Meta
The ETag value for the file. This is just the file hash, wrapped with
quote symbols. Read more
sourcefn mime_type(&self) -> Option<<DynamicFile as EmbedableFile>::Meta>
fn mime_type(&self) -> Option<<DynamicFile as EmbedableFile>::Meta>
The mime type for the file, if one can be guessed from the file
extension. Read more
sourceimpl PartialEq<DynamicFile> for DynamicFile
impl PartialEq<DynamicFile> for DynamicFile
sourcefn eq(&self, other: &DynamicFile) -> bool
fn eq(&self, other: &DynamicFile) -> bool
Auto Trait Implementations
impl RefUnwindSafe for DynamicFile
impl Send for DynamicFile
impl Sync for DynamicFile
impl Unpin for DynamicFile
impl UnwindSafe for DynamicFile
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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