pub struct EmbeddedFile { /* private fields */ }
Expand description
A file embedded into the binary.
rust-embed-for-web
changes which type of file you get based on whether
it’s a debug or release build. In release builds or with the always-embed
flag, you’ll get EmbeddedFile
s.
You should interface with this object using the EmbedableFile
trait, which
is implemented for both the embedded and dynamic files.
Trait Implementations§
Source§impl Clone for EmbeddedFile
impl Clone for EmbeddedFile
Source§fn clone(&self) -> EmbeddedFile
fn clone(&self) -> EmbeddedFile
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 EmbeddedFile
impl Debug for EmbeddedFile
Source§impl EmbedableFile for EmbeddedFile
impl EmbedableFile for EmbeddedFile
type Data = &'static [u8]
type Meta = &'static str
Source§fn name(&self) -> <EmbeddedFile as EmbedableFile>::Meta
fn name(&self) -> <EmbeddedFile as EmbedableFile>::Meta
The name of the embedded file.
Source§fn data(&self) -> <EmbeddedFile as EmbedableFile>::Data
fn data(&self) -> <EmbeddedFile as EmbedableFile>::Data
The contents of the embedded file.
Source§fn data_gzip(&self) -> Option<<EmbeddedFile as EmbedableFile>::Data>
fn data_gzip(&self) -> Option<<EmbeddedFile as EmbedableFile>::Data>
The contents of the file, compressed with gzip. Read more
Source§fn data_br(&self) -> Option<<EmbeddedFile as EmbedableFile>::Data>
fn data_br(&self) -> Option<<EmbeddedFile as EmbedableFile>::Data>
The contents of the file, compressed with brotli. Read more
Source§fn last_modified(&self) -> Option<<EmbeddedFile as EmbedableFile>::Meta>
fn last_modified(&self) -> Option<<EmbeddedFile as EmbedableFile>::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) -> <EmbeddedFile as EmbedableFile>::Meta
fn hash(&self) -> <EmbeddedFile as EmbedableFile>::Meta
The hash value for the file. This is a base85 encoded sha256 hash.
Source§fn etag(&self) -> <EmbeddedFile as EmbedableFile>::Meta
fn etag(&self) -> <EmbeddedFile as EmbedableFile>::Meta
The ETag value for the file. This is just the file hash, wrapped with
quote symbols.
Source§fn mime_type(&self) -> Option<<EmbeddedFile as EmbedableFile>::Meta>
fn mime_type(&self) -> Option<<EmbeddedFile as EmbedableFile>::Meta>
The mime type for the file, if one can be guessed from the file
extension.
Source§impl PartialEq for EmbeddedFile
impl PartialEq for EmbeddedFile
impl Copy for EmbeddedFile
Auto Trait Implementations§
impl Freeze for EmbeddedFile
impl RefUnwindSafe for EmbeddedFile
impl Send for EmbeddedFile
impl Sync for EmbeddedFile
impl Unpin for EmbeddedFile
impl UnwindSafe for EmbeddedFile
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