Struct actix_swagger::Answer
source · [−]pub struct Answer<'a, T> { /* private fields */ }
Expand description
Strict answer to complain with generated code by cargo-swagg
Implementations
sourceimpl<'a, T: Serialize> Answer<'a, T>
impl<'a, T: Serialize> Answer<'a, T>
pub fn new(response: T) -> Answer<'a, T>
sourcepub fn header<V>(self, key: String, value: V) -> Selfwhere
V: TryIntoHeaderValue,
pub fn header<V>(self, key: String, value: V) -> Selfwhere
V: TryIntoHeaderValue,
Set header to answer
Add cookie to answer
sourcepub fn status(self, status: StatusCode) -> Self
pub fn status(self, status: StatusCode) -> Self
Set status code
sourcepub fn content_type(self, content_type: Option<ContentType>) -> Self
pub fn content_type(self, content_type: Option<ContentType>) -> Self
Set content-type Content-Type changes serializer for answer
Trait Implementations
sourceimpl<'a, T: Serialize> Responder for Answer<'a, T>
impl<'a, T: Serialize> Responder for Answer<'a, T>
type Body = BoxBody
sourcefn respond_to(self, _: &HttpRequest) -> HttpResponse
fn respond_to(self, _: &HttpRequest) -> HttpResponse
Convert self to
HttpResponse
.sourcefn customize(self) -> CustomizeResponder<Self>
fn customize(self) -> CustomizeResponder<Self>
Wraps responder to allow alteration of its 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more