pub struct Asset {
pub route: &'static str,
pub path: &'static str,
pub etag: &'static str,
pub content_type: &'static str,
pub bytes: Option<&'static [u8]>,
pub is_compressed: bool,
pub should_compress: bool,
}Expand description
Represents a static asset that can be served
Fields§
§route: &'static strThe HTTP route used to serve the asset, e.g. /index.html.
path: &'static strAbsolute filesystem path pointing to the source asset on disk.
etag: &'static strStrong validator (SHA-256) used for HTTP caching semantics.
content_type: &'static strMIME type advertised for the asset.
bytes: Option<&'static [u8]>Optional embedded bytes for the asset; None when dynamic loading is used.
is_compressed: boolIndicates if the embedded bytes are already brotli compressed.
should_compress: boolWhether the asset should be compressed before sending to clients.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Asset
impl RefUnwindSafe for Asset
impl Send for Asset
impl Sync for Asset
impl Unpin for Asset
impl UnwindSafe for Asset
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