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§
Source§impl DynamicFile
impl DynamicFile
pub fn read_from_fs<P: AsRef<Path>>(path: P) -> Result<Self>
Trait Implementations§
Source§impl Clone for DynamicFile
impl Clone for DynamicFile
Source§fn clone(&self) -> DynamicFile
fn clone(&self) -> DynamicFile
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 DynamicFile
impl Debug for DynamicFile
Source§impl EmbedableFile for DynamicFile
impl EmbedableFile for DynamicFile
type Data = Vec<u8>
type Meta = String
Source§fn data_gzip(&self) -> Option<Self::Data>
fn data_gzip(&self) -> Option<Self::Data>
The contents of the file, compressed with gzip. Read more
Source§fn data_br(&self) -> Option<Self::Data>
fn data_br(&self) -> Option<Self::Data>
The contents of the file, compressed with brotli. Read more
Source§fn last_modified(&self) -> Option<Self::Meta>
fn last_modified(&self) -> Option<Self::Meta>
The rfc2822 encoded last modified date. This is the format you use for
Last-Modified
headers.Source§fn last_modified_timestamp(&self) -> Option<i64>
fn last_modified_timestamp(&self) -> Option<i64>
The UNIX timestamp of when the file was last modified.
Source§fn hash(&self) -> Self::Meta
fn hash(&self) -> Self::Meta
The hash value for the file. This is a base85 encoded sha256 hash.
Source§impl PartialEq for DynamicFile
impl PartialEq for DynamicFile
Auto Trait Implementations§
impl Freeze for DynamicFile
impl RefUnwindSafe for DynamicFile
impl Send for DynamicFile
impl Sync for DynamicFile
impl Unpin for DynamicFile
impl UnwindSafe for DynamicFile
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