Skip to main content

Shape

Trait Shape 

Source
pub trait Shape<'req>: Sized {
    type StreamInner: Future<Output = Option<Shared>> + 'static;

    // Provided methods
    fn write_into_slice(&self, out: &mut [u8], date: &[u8; 29]) -> Option<usize> { ... }
    fn preserialize(&self) -> (Vec<u8>, usize) { ... }
    fn write_head_only(
        &self,
        out: &mut [u8],
        date: &[u8; 29],
    ) -> Option<(usize, &'static [u8])> { ... }
    fn write_head_split(
        self,
        out: &mut [u8],
        date: &[u8; 29],
    ) -> Option<(usize, Shared)> { ... }
    fn preserialize_static(&self) -> Option<(Vec<u8>, usize, &'static [u8])> { ... }
    fn write_head_stream(
        self,
        out: &mut [u8],
        date: &[u8; 29],
    ) -> Option<(usize, Self::StreamInner)> { ... }
    fn body_for_gzip(&self) -> Option<&[u8]> { ... }
    fn apply_gzip_body(&mut self, _compressed: Shared) { ... }
    fn status(&self) -> StatusCode { ... }
    fn body_bytes(&self) -> &[u8]  { ... }
    fn headers_wire(&self) -> Shared { ... }
}

Required Associated Types§

Source

type StreamInner: Future<Output = Option<Shared>> + 'static

Provided Methods§

Source

fn write_into_slice(&self, out: &mut [u8], date: &[u8; 29]) -> Option<usize>

Source

fn preserialize(&self) -> (Vec<u8>, usize)

Source

fn write_head_only( &self, out: &mut [u8], date: &[u8; 29], ) -> Option<(usize, &'static [u8])>

Source

fn write_head_split( self, out: &mut [u8], date: &[u8; 29], ) -> Option<(usize, Shared)>

Source

fn preserialize_static(&self) -> Option<(Vec<u8>, usize, &'static [u8])>

Source

fn write_head_stream( self, out: &mut [u8], date: &[u8; 29], ) -> Option<(usize, Self::StreamInner)>

Source

fn body_for_gzip(&self) -> Option<&[u8]>

Source

fn apply_gzip_body(&mut self, _compressed: Shared)

Source

fn status(&self) -> StatusCode

Source

fn body_bytes(&self) -> &[u8]

Source

fn headers_wire(&self) -> Shared

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'req, S> Shape<'req> for Stream<S>
where S: Future<Output = Option<Shared>> + 'static,

Source§

impl<'req> Shape<'req> for Chunked

Source§

impl<'req> Shape<'req> for FixedResponseInner<'req>

Source§

impl<'req> Shape<'req> for MonoResponseInner<'req>

Source§

impl<'req> Shape<'req> for ServeInner<'req>