[−][src]Struct web_static_pack::hyper_loader::StaticBody
Represents hyper HttpBody compatible response based on static memory chunk. This is used as a body handler for u8 content, directly from loader.
Implementations
impl StaticBody[src]
pub fn new(content: &'static [u8]) -> Self[src]
Constructor.
Creates StaticBody from static memory slice.
Whole content will be sent.
Trait Implementations
impl Body for StaticBody[src]
type Data = &'static [u8]
Values yielded by the Body.
type Error = Infallible
The error type this Body might generate.
fn poll_data(
self: Pin<&mut Self>,
_cx: &mut Context
) -> Poll<Option<Result<Self::Data, Self::Error>>>[src]
self: Pin<&mut Self>,
_cx: &mut Context
) -> Poll<Option<Result<Self::Data, Self::Error>>>
Sends up to CHUNK_SIZE data at once.
fn poll_trailers(
self: Pin<&mut Self>,
_cx: &mut Context
) -> Poll<Result<Option<HeaderMap>, Self::Error>>[src]
self: Pin<&mut Self>,
_cx: &mut Context
) -> Poll<Result<Option<HeaderMap>, Self::Error>>
We don't use any trailers, so this always returns Ready-No-Headers value.
fn is_end_stream(&self) -> bool[src]
fn size_hint(&self) -> SizeHint[src]
fn data(&mut self) -> Data<Self> where
Self: Unpin, [src]
Self: Unpin,
fn trailers(&mut self) -> Trailers<Self> where
Self: Unpin, [src]
Self: Unpin,
impl Default for StaticBody[src]
Auto Trait Implementations
impl RefUnwindSafe for StaticBody
impl Send for StaticBody
impl Sync for StaticBody
impl Unpin for StaticBody
impl UnwindSafe for StaticBody
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,