pub struct StaticResponseInner<'req, const N: usize = DEFAULT_HEADER_CAPACITY, S = StaticHeaderBytes> { /* private fields */ }Expand description
A response whose body is guaranteed to live for the entire process.
Keeping the static slice directly avoids paying for the largest variant of
Body on generated static-response routes.
Implementations§
Source§impl<'req, const N: usize> StaticResponseInner<'req, N>
impl<'req, const N: usize> StaticResponseInner<'req, N>
Source§impl<'req, const N: usize, S> StaticResponseInner<'req, N, S>where
S: StaticHeaders,
impl<'req, const N: usize, S> StaticResponseInner<'req, N, S>where
S: StaticHeaders,
pub fn status(&self) -> StatusCode
pub fn body_ref(&self) -> &'static [u8] ⓘ
pub fn wire_headers(&self) -> Shared
pub fn write_into_slice(&self, out: &mut [u8], date: &[u8; 29]) -> Option<usize>
pub fn write_head_only( &self, out: &mut [u8], date: &[u8; 29], ) -> Option<(usize, &'static [u8])>
pub fn write_head_split( self, out: &mut [u8], date: &[u8; 29], ) -> Option<(usize, Shared)>
pub fn preserialize_static(&self) -> (Vec<u8>, usize, &'static [u8])
Trait Implementations§
Source§impl<'req, const N: usize, S: Clone> Clone for StaticResponseInner<'req, N, S>
impl<'req, const N: usize, S: Clone> Clone for StaticResponseInner<'req, N, S>
Source§fn clone(&self) -> StaticResponseInner<'req, N, S>
fn clone(&self) -> StaticResponseInner<'req, N, S>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'req, const N: usize, S> IntoResponseShape<'req> for StaticResponseInner<'req, N, S>where
S: StaticHeaders,
impl<'req, const N: usize, S> IntoResponseShape<'req> for StaticResponseInner<'req, N, S>where
S: StaticHeaders,
type Shape = StaticResponseInner<'req, N, S>
fn into_response_shape(self) -> Self::Shape
Source§impl<'req, const N: usize, S> Shape<'req> for StaticResponseInner<'req, N, S>where
S: StaticHeaders,
impl<'req, const N: usize, S> Shape<'req> for StaticResponseInner<'req, N, S>where
S: StaticHeaders,
type Metadata = StaticShape
fn prepare( self, mode: Preparation, _gzip: Option<&mut Gzip>, out: &mut [u8], date: &[u8; 29], ) -> Prepared<<Self::Metadata as ShapeMetadata>::Stream>
fn response_view(&self) -> Option<ResponseView>
fn emit<E: ResponseSink>(self, sink: &mut E) -> bool
Auto Trait Implementations§
impl<'req, const N: usize = DEFAULT_HEADER_CAPACITY, S = StaticHeaderBytes> !RefUnwindSafe for StaticResponseInner<'req, N, S>
impl<'req, const N: usize = DEFAULT_HEADER_CAPACITY, S = StaticHeaderBytes> !Send for StaticResponseInner<'req, N, S>
impl<'req, const N: usize = DEFAULT_HEADER_CAPACITY, S = StaticHeaderBytes> !Sync for StaticResponseInner<'req, N, S>
impl<'req, const N: usize = DEFAULT_HEADER_CAPACITY, S = StaticHeaderBytes> !UnwindSafe for StaticResponseInner<'req, N, S>
impl<'req, const N: usize, S> Freeze for StaticResponseInner<'req, N, S>where
S: Freeze,
impl<'req, const N: usize, S> Unpin for StaticResponseInner<'req, N, S>where
S: Unpin,
impl<'req, const N: usize, S> UnsafeUnpin for StaticResponseInner<'req, N, S>where
S: UnsafeUnpin,
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