Trait rust_embed_for_web::EmbedableFile
source · pub trait EmbedableFile {
type Data: 'static + AsRef<[u8]>;
type Meta: 'static + AsRef<str>;
fn name(&self) -> Self::Meta;
fn data(&self) -> Self::Data;
fn data_gzip(&self) -> Option<Self::Data>;
fn data_br(&self) -> Option<Self::Data>;
fn last_modified_timestamp(&self) -> Option<i64>;
fn last_modified(&self) -> Option<Self::Meta>;
fn hash(&self) -> Self::Meta;
fn etag(&self) -> Self::Meta;
fn mime_type(&self) -> Option<Self::Meta>;
}
Expand description
An embedable file.
The file is embedded into the program for release builds, and dynamically read for debug builds.
Required Associated Types
Required Methods
sourcefn data_gzip(&self) -> Option<Self::Data>
fn data_gzip(&self) -> Option<Self::Data>
The contents of the file, compressed with gzip.
If precompression has been done. None if the file was not precompressed.
sourcefn data_br(&self) -> Option<Self::Data>
fn data_br(&self) -> Option<Self::Data>
The contents of the file, compressed with brotli.
If precompression has been done. None if the file was not precompressed.
sourcefn last_modified_timestamp(&self) -> Option<i64>
fn last_modified_timestamp(&self) -> Option<i64>
The timestamp of when the file was last modified.
sourcefn last_modified(&self) -> Option<Self::Meta>
fn last_modified(&self) -> Option<Self::Meta>
The rfc2822 encoded last modified date.