pub struct StaticResponseInner<'req, const N: usize = DEFAULT_HEADER_CAPACITY> { /* 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
HotBodyInner on generated static-response routes.
Implementations§
Source§impl<'req, const N: usize> StaticResponseInner<'req, N>
impl<'req, const N: usize> StaticResponseInner<'req, N>
pub fn direct( status: StatusCode, static_headers: &'static [u8], headers: Headers<'req, N>, body: &'static [u8], ) -> Self
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> Clone for StaticResponseInner<'req, N>
impl<'req, const N: usize> Clone for StaticResponseInner<'req, N>
Source§fn clone(&self) -> StaticResponseInner<'req, N>
fn clone(&self) -> StaticResponseInner<'req, N>
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> Debug for StaticResponseInner<'req, N>
impl<'req, const N: usize> Debug for StaticResponseInner<'req, N>
Source§impl<'req, const N: usize> Shape<'req> for StaticResponseInner<'req, N>
impl<'req, const N: usize> Shape<'req> for StaticResponseInner<'req, N>
type StreamInner = NeverStream
fn prepare( self, mode: Preparation, _gzip: Option<&mut Gzip>, out: &mut [u8], date: &[u8; 29], ) -> Prepared<Self::StreamInner>
fn response_view(&self) -> Option<ResponseView>
Auto Trait Implementations§
impl<'req, const N: usize = DEFAULT_HEADER_CAPACITY> !RefUnwindSafe for StaticResponseInner<'req, N>
impl<'req, const N: usize = DEFAULT_HEADER_CAPACITY> !Send for StaticResponseInner<'req, N>
impl<'req, const N: usize = DEFAULT_HEADER_CAPACITY> !Sync for StaticResponseInner<'req, N>
impl<'req, const N: usize = DEFAULT_HEADER_CAPACITY> !UnwindSafe for StaticResponseInner<'req, N>
impl<'req, const N: usize> Freeze for StaticResponseInner<'req, N>
impl<'req, const N: usize> Unpin for StaticResponseInner<'req, N>
impl<'req, const N: usize> UnsafeUnpin for StaticResponseInner<'req, N>
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