pub struct Struct {
pub Mapping: Mmap,
pub Mime: &'static str,
pub Length: usize,
pub Brotli: Option<Mmap>,
}Fields§
§Mapping: MmapThe MemoryMap mapping itself. Keep alive as long as any webview body references it.
Mime: &'static strCached MIME from the file extension. Avoids the match arm on the hot path.
Length: usizeFile size at MemoryMap time. Used for Content-Length.
Brotli: Option<Mmap>Optional pre-brotli-compressed sibling (path with .br
suffix). None if no sibling existed at load time.
Implementations§
Source§impl Struct
impl Struct
Sourcepub fn AsSlice(&self) -> &[u8] ⓘ
pub fn AsSlice(&self) -> &[u8] ⓘ
Borrow the entire mapping as a slice. Caller keeps
Arc<Struct> alive for the lifetime of any response body that
captures the slice.
Sourcepub fn AsBrotliSlice(&self) -> Option<&[u8]>
pub fn AsBrotliSlice(&self) -> Option<&[u8]>
Borrow the brotli-precompressed sibling if present.
Sourcepub fn BrotliLength(&self) -> Option<usize>
pub fn BrotliLength(&self) -> Option<usize>
Length of the brotli sibling. Useful for Content-Length when
serving the precompressed payload.
Auto Trait Implementations§
impl Freeze for Struct
impl RefUnwindSafe for Struct
impl Send for Struct
impl Sync for Struct
impl Unpin for Struct
impl UnsafeUnpin for Struct
impl UnwindSafe for Struct
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