pub trait OpenApiOutputAlg<From> {
// Required method
fn answers(schema: &JsonSchemaShape) -> Vec<OpenApiAnswer>;
}Expand description
States how a document describes what one output kind answers with.
An interpretation that runs converts a value it was given. This one has no value, so what an endpoint answers with has to be read from the kind’s type.
Required Methods§
Sourcefn answers(schema: &JsonSchemaShape) -> Vec<OpenApiAnswer>
fn answers(schema: &JsonSchemaShape) -> Vec<OpenApiAnswer>
Describes every answer this kind states, naming the shapes it mentions along the way.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl OpenApiOutputAlg<()> for OpenApiEmptyOutput
impl<File, Error> OpenApiOutputAlg<(Result<File, Error>, String)> for OpenApiFileOutputwhere
Error: HttpErrorAlg,
Describes a download: the bytes it answers with, and what reading the file can fail as.
A file handler answers with the file it read and the name to offer it under, so the failure is
stated by the file rather than by a .result() around the endpoint. Both halves are described
here: the successful body is bytes, and the failure states its own statuses.
impl<From> OpenApiOutputAlg<From> for OpenApiBytesOutput
Describes the bytes an endpoint answers with, whatever produced them.
What a caller receives is bytes, so the document says so: a shape would describe the value the handler answered with rather than the body it becomes, and a body produced over time has no shape to describe at all.