pub struct EmbeddedResource {
pub data: &'static [u8],
pub content_type: Option<ContentType>,
}Fields§
§data: &'static [u8]§content_type: Option<ContentType>Implementations§
Source§impl EmbeddedResource
impl EmbeddedResource
pub fn new( _data: &'static (impl AsRef<[u8]> + ?Sized), _content_type: Option<ContentType>, ) -> Self
pub const fn new_const( _data: &'static [u8], _content_type: Option<ContentType>, ) -> Self
pub fn new_text(_data: &'static (impl AsRef<[u8]> + ?Sized)) -> Self
pub fn new_html(_data: &'static (impl AsRef<[u8]> + ?Sized)) -> Self
pub fn new_css(_data: &'static (impl AsRef<[u8]> + ?Sized)) -> Self
pub fn new_js(_data: &'static (impl AsRef<[u8]> + ?Sized)) -> Self
pub fn new_json(_data: &'static (impl AsRef<[u8]> + ?Sized)) -> Self
pub fn new_xml(_data: &'static (impl AsRef<[u8]> + ?Sized)) -> Self
pub fn new_png(_data: &'static (impl AsRef<[u8]> + ?Sized)) -> Self
pub fn new_jpeg(_data: &'static (impl AsRef<[u8]> + ?Sized)) -> Self
pub fn new_svg(_data: &'static (impl AsRef<[u8]> + ?Sized)) -> Self
pub fn new_icon(_data: &'static (impl AsRef<[u8]> + ?Sized)) -> Self
pub fn response(&self) -> Response<Body>
Trait Implementations§
Source§impl Handler for EmbeddedResource
Available on crate features hss-handler and hss-resources only.
impl Handler for EmbeddedResource
Available on crate features
hss-handler and hss-resources only.type Future = Ready<Result<Response<<EmbeddedResource as Handler>::ResponseBody>, Error>>
type ResponseBody = BodyWrapper<Body>
type ResponseBodyError = Error
fn handle(&self, _request: Request<Body>) -> Self::Future
fn wrap(self) -> HandlerWrapper<Self>where
Self: Sized,
Auto Trait Implementations§
impl Freeze for EmbeddedResource
impl RefUnwindSafe for EmbeddedResource
impl Send for EmbeddedResource
impl Sync for EmbeddedResource
impl Unpin for EmbeddedResource
impl UnsafeUnpin for EmbeddedResource
impl UnwindSafe for EmbeddedResource
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