pub struct StaticAsset {
pub bytes: &'static [u8],
pub mime: MimeType,
}Expand description
A static blob of bytes
Fields§
§bytes: &'static [u8]The data to return
mime: MimeTypeThe type of bytes
Trait Implementations§
Source§impl Servable for StaticAsset
Available on non-crate feature image only.
impl Servable for StaticAsset
Available on non-crate feature
image only.Source§fn head<'a>(
&'a self,
_ctx: &'a RenderContext,
) -> Pin<Box<dyn Future<Output = Rendered<()>> + Send + Sync + 'a>>
fn head<'a>( &'a self, _ctx: &'a RenderContext, ) -> Pin<Box<dyn Future<Output = Rendered<()>> + Send + Sync + 'a>>
Return the same response as Servable::render, but with an empty body. Read more
Source§fn render<'a>(
&'a self,
ctx: &'a RenderContext,
) -> Pin<Box<dyn Future<Output = Rendered<RenderedBody>> + Send + Sync + 'a>>
fn render<'a>( &'a self, ctx: &'a RenderContext, ) -> Pin<Box<dyn Future<Output = Rendered<RenderedBody>> + Send + Sync + 'a>>
Render this page. Must return the same metadata as Servable::head.
Consider using crate::Rendered::with_body and Servable::head to implement this fn. Read more
Auto Trait Implementations§
impl Freeze for StaticAsset
impl RefUnwindSafe for StaticAsset
impl Send for StaticAsset
impl Sync for StaticAsset
impl Unpin for StaticAsset
impl UnwindSafe for StaticAsset
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