[][src]Struct web_static_pack::hyper_loader::StaticBody

pub struct StaticBody { /* fields omitted */ }

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]

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]

We don't use any trailers, so this always returns Ready-No-Headers value.

impl Default for StaticBody[src]

fn default() -> Self[src]

Creates StaticBody initialized with empty chunk, therefore yielding empty body.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.