pub struct OpenApiAnswer {
pub status: HttpStatus,
pub headers: Vec<&'static str>,
pub content_type: Option<&'static str>,
pub schema: Option<Value>,
}Expand description
One answer an endpoint states, as a document describes it.
Fields§
§status: HttpStatusThe status this answer carries.
headers: Vec<&'static str>Every header this answer carries beside its body.
content_type: Option<&'static str>The media type this answer is written as, where it has a body.
schema: Option<Value>The schema this answer’s body carries, where it has one.
Implementations§
Source§impl OpenApiAnswer
impl OpenApiAnswer
Sourcepub fn content(
status: HttpStatus,
content_type: &'static str,
schema: Value,
) -> Self
pub fn content( status: HttpStatus, content_type: &'static str, schema: Value, ) -> Self
States an answer carrying a body of a stated media type.
Sourcepub fn bodiless(status: HttpStatus) -> Self
pub fn bodiless(status: HttpStatus) -> Self
States an answer carrying no body.
Trait Implementations§
Source§impl Clone for OpenApiAnswer
impl Clone for OpenApiAnswer
Source§fn clone(&self) -> OpenApiAnswer
fn clone(&self) -> OpenApiAnswer
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 moreAuto Trait Implementations§
impl Freeze for OpenApiAnswer
impl RefUnwindSafe for OpenApiAnswer
impl Send for OpenApiAnswer
impl Sync for OpenApiAnswer
impl Unpin for OpenApiAnswer
impl UnsafeUnpin for OpenApiAnswer
impl UnwindSafe for OpenApiAnswer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<This> HttpProgramExt<This> for This
impl<This> HttpProgramExt<This> for This
Source§fn compile_http<Program>(
&self,
program: Program,
) -> <Program as HttpProgramAlg<This>>::Routewhere
Program: HttpProgramAlg<This>,
fn compile_http<Program>(
&self,
program: Program,
) -> <Program as HttpProgramAlg<This>>::Routewhere
Program: HttpProgramAlg<This>,
Compiles a named HTTP program with this interpreter.
Source§impl<This> ShapeProgramExt<This> for This
impl<This> ShapeProgramExt<This> for This
Source§fn compile_shape<Program>(
&self,
program: Program,
) -> <Program as ShapeProgramAlg<This>>::Tywhere
Program: ShapeProgramAlg<This>,
fn compile_shape<Program>(
&self,
program: Program,
) -> <Program as ShapeProgramAlg<This>>::Tywhere
Program: ShapeProgramAlg<This>,
Folds a declaration with this interpretation.