Struct actix_swagger::Answer[][src]

pub struct Answer<'a, T> { /* fields omitted */ }
Expand description

Strict answer to complain with generated code by cargo-swagg

Implementations

impl<'a, T: Serialize> Answer<'a, T>[src]

pub fn new(response: T) -> Answer<'a, T>[src]

pub fn header<V>(self, key: String, value: V) -> Self where
    V: IntoHeaderValue
[src]

Set header to answer

pub fn cookie(self, cookie: Cookie<'a>) -> Self[src]

Add cookie to answer

pub fn status(self, status: StatusCode) -> Self[src]

Set status code

pub fn content_type(self, content_type: Option<ContentType>) -> Self[src]

Set content-type Content-Type changes serializer for answer

pub fn to_string(&self) -> Result<String, Error>[src]

Serialize answer

Trait Implementations

impl<'a, T: Serialize> Responder for Answer<'a, T>[src]

fn respond_to(self, _: &HttpRequest) -> HttpResponse[src]

Convert self to HttpResponse.

fn with_status(self, status: StatusCode) -> CustomResponder<Self>[src]

Override a status code for a Responder. Read more

fn with_header<H>(self, header: H) -> CustomResponder<Self> where
    H: IntoHeaderPair
[src]

Insert header to the final response. Read more

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for Answer<'a, T> where
    T: RefUnwindSafe

impl<'a, T> Send for Answer<'a, T> where
    T: Send

impl<'a, T> Sync for Answer<'a, T> where
    T: Sync

impl<'a, T> Unpin for Answer<'a, T> where
    T: Unpin

impl<'a, T> UnwindSafe for Answer<'a, T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V