Skip to main content

Shape

Trait Shape 

Source
pub trait Shape<'req>: Sized {
    type StreamInner: '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 write_gzip_head(
        self,
        out: &mut [u8],
        date: &[u8; 29],
        body_len: usize,
    ) -> Option<usize> { ... }
    fn status(&self) -> StatusCode { ... }
    fn body_bytes(&self) -> &[u8]  { ... }
    fn headers_wire(&self) -> Shared { ... }
}

Required Associated Types§

Source

type StreamInner: '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 write_gzip_head( self, out: &mut [u8], date: &[u8; 29], body_len: usize, ) -> Option<usize>

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, B, const N: usize> Shape<'req> for EncodedResponseInner<'req, B, N>
where B: EncodedBody,

Source§

impl<'req, S> Shape<'req> for Stream<S>
where S: 'static,

Source§

impl<'req, const N: usize> Shape<'req> for FixedResponseInner<'req, N>

Source§

impl<'req, const N: usize> Shape<'req> for MonoResponseInner<'req, N>

Source§

impl<'req, const N: usize> Shape<'req> for ServeInner<'req, N>

Source§

impl<'req, const N: usize> Shape<'req> for StaticResponseInner<'req, N>

Source§

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