pub struct Asset<'a> { /* private fields */ }Expand description
One served path of an AssetArchive.
Implementations§
Source§impl<'a> Asset<'a>
impl<'a> Asset<'a>
pub fn status(&self) -> StatusCode
Sourcepub fn headers(&self) -> impl Iterator<Item = &'a (HeaderName, HeaderValue)>
pub fn headers(&self) -> impl Iterator<Item = &'a (HeaderName, HeaderValue)>
The stored response headers, without the ones the server derives.
Sourcepub fn keeps_query(&self) -> bool
pub fn keeps_query(&self) -> bool
Whether a redirect appends the request’s query to its Location.
Sourcepub fn hash(&self) -> &'a [u8; 16]
pub fn hash(&self) -> &'a [u8; 16]
The first 16 bytes of the SHA-256 of the decompressed asset.
Sourcepub fn decompressed(&self) -> Result<Bytes>
pub fn decompressed(&self) -> Result<Bytes>
The decompressed bytes. Fails when the stored stream is corrupt or does not decode to the recorded size.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Forget for Asset<'a>
impl<'a> Freeze for Asset<'a>
impl<'a> Move for Asset<'a>
impl<'a> RefUnwindSafe for Asset<'a>
impl<'a> Send for Asset<'a>
impl<'a> Sync for Asset<'a>
impl<'a> Unpin for Asset<'a>
impl<'a> UnsafeUnpin for Asset<'a>
impl<'a> UnwindSafe for Asset<'a>
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