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

The name of the embedded file.

The contents of the embedded file.

The contents of the file, compressed with gzip.

If precompression has been done. None if the file was not precompressed.

The contents of the file, compressed with brotli.

If precompression has been done. None if the file was not precompressed.

The timestamp of when the file was last modified.

The rfc2822 encoded last modified date.

The hash value for the file.

The ETag value for the file, based on its hash.

The mime type for the file, if one is or can be guessed from the file.

Implementors