Skip to main content

Response

Struct Response 

Source
pub struct Response<'field, B = [u8; 0], T = (), S = Code, N = Name<Cow<'field, str>>> { /* private fields */ }

Implementations§

Source§

impl<'field, B, T, S, N> Response<'field, B, T, S, N>

Source

pub fn status(&self) -> S
where S: Copy,

Source

pub fn headers(&self) -> &List<'field, N>

Source

pub fn body(&self) -> &B

Source

pub fn body_mut(&mut self) -> &mut B

Source

pub fn into_body(self) -> B

Source

pub fn with_body<U>(self, body: U) -> Response<'field, U, T, S, N>

Source§

impl<'field, B, S, N> Response<'field, B, List<'field>, S, N>

Source

pub fn trailers(&self) -> &List<'field>

Source§

impl<'field> Response<'field, [u8; 0]>

Source

pub fn new(status: Code) -> Self

Trait Implementations§

Source§

impl<'field, 'req, 'd, Ranges: Copy + 'd, D, B> Emit<'req, 'd, D, Ranges> for Response<'field, B, (), Code>
where B: Body<'d, Ranges>,

Source§

const BODY: Kind = payload::Kind::Inline

Source§

type Kind = Sync

Source§

type Stream = Never

Source§

type Bound = Unbounded

Source§

fn consume<W: Transaction<'req, 'd, Never, Ranges>>(self, writer: W) -> W::Done

Source§

const DECLARED: Option<Head<Self>> = None

Source§

fn into_exact(self) -> Result<impl Reply, Self>

Auto Trait Implementations§

§

impl<'field, B, T, S, N> Forget for Response<'field, B, T, S, N>

§

impl<'field, B, T, S, N> Freeze for Response<'field, B, T, S, N>
where S: Freeze, *const u8 is !null: Freeze, PhantomData<(N, Value<Cow<'field, [u8]>>)>: Freeze, T: Freeze, B: Freeze,

§

impl<'field, B, T, S, N> Move for Response<'field, B, T, S, N>

§

impl<'field, B, T, S, N> RefUnwindSafe for Response<'field, B, T, S, N>

§

impl<'field, B, T, S, N> Send for Response<'field, B, T, S, N>
where N: Send, S: Send, T: Send, B: Send, RawVecInner: Send, &'field [u8]: Send, Vec<u8>: Send,

§

impl<'field, B, T, S, N> Sync for Response<'field, B, T, S, N>
where N: Sync, S: Sync, T: Sync, B: Sync, RawVecInner: Sync, Vec<u8>: Sync,

§

impl<'field, B, T, S, N> Unpin for Response<'field, B, T, S, N>
where N: Unpin, S: Unpin, T: Unpin, B: Unpin, *const u8 is !null: Unpin, &'field [u8]: Unpin, Vec<u8>: Unpin,

§

impl<'field, B, T, S, N> UnsafeUnpin for Response<'field, B, T, S, N>
where S: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<(N, Value<Cow<'field, [u8]>>)>: UnsafeUnpin, T: UnsafeUnpin, B: UnsafeUnpin,

§

impl<'field, B, T, S, N> UnwindSafe for Response<'field, B, T, S, N>
where S: UnwindSafe, RawVecInner: UnwindSafe, N: UnwindSafe, &'field [u8]: UnwindSafe, Vec<u8>: UnwindSafe, T: UnwindSafe, B: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<L, R> Convert<Either<L, R>, 1> for L

Source§

fn into(self) -> Either<L, R>

Source§

unsafe fn take_into(source: *mut Self, place: &mut MaybeUninit<T>)
where Self: Sized,

Safety Read more
Source§

impl<L, R> Convert<Either<L, R>, 2> for R

Source§

fn into(self) -> Either<L, R>

Source§

unsafe fn take_into(source: *mut Self, place: &mut MaybeUninit<T>)
where Self: Sized,

Safety Read more
Source§

impl<T> Convert<T> for T

Source§

fn into(self) -> T

Source§

unsafe fn take_into(source: *mut Self, place: &mut MaybeUninit<T>)
where Self: Sized,

Safety Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<S> Source<Polled> for S

Source§

fn length(&self) -> u64

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.