pub struct Operation { /* private fields */ }Available on crate feature
openapi only.Expand description
What a client needs to know about one operation beyond its method and
path. Schemas are JSON text, normally from JsonSchema.
Implementations§
Source§impl Operation
impl Operation
Sourcepub fn description(self, description: impl Into<String>) -> Operation
pub fn description(self, description: impl Into<String>) -> Operation
A longer description (CommonMark).
Sourcepub fn operation_id(self, id: impl Into<String>) -> Operation
pub fn operation_id(self, id: impl Into<String>) -> Operation
A unique operationId (client generators name methods after it).
Sourcepub fn deprecated(self) -> Operation
pub fn deprecated(self) -> Operation
Mark the operation deprecated.
Sourcepub fn path_param<T>(self, name: &str) -> Operationwhere
T: JsonSchema + ?Sized,
pub fn path_param<T>(self, name: &str) -> Operationwhere
T: JsonSchema + ?Sized,
Path parameter name holds a T (default: a string).
Sourcepub fn path_param_schema(
self,
name: &str,
schema: &str,
description: &str,
) -> Operation
pub fn path_param_schema( self, name: &str, schema: &str, description: &str, ) -> Operation
Path parameter name with an explicit schema and description.
Sourcepub fn query<T>(self) -> Operationwhere
T: JsonSchema + ?Sized,
pub fn query<T>(self) -> Operationwhere
T: JsonSchema + ?Sized,
Query parameters: one per property of T (a struct), required as the
struct requires them — the type a handler parses the query into.
Sourcepub fn query_param(self, name: &str, schema: &str, required: bool) -> Operation
pub fn query_param(self, name: &str, schema: &str, required: bool) -> Operation
One query parameter with an explicit schema.
Sourcepub fn body<T>(self) -> Operationwhere
T: JsonSchema + ?Sized,
pub fn body<T>(self) -> Operationwhere
T: JsonSchema + ?Sized,
A required application/json request body holding a T.
Sourcepub fn body_schema(
self,
content_type: &str,
schema: &str,
required: bool,
) -> Operation
pub fn body_schema( self, content_type: &str, schema: &str, required: bool, ) -> Operation
A request body of content_type with an explicit schema.
Sourcepub fn response<T>(self, status: u16, description: &str) -> Operationwhere
T: JsonSchema + ?Sized,
pub fn response<T>(self, status: u16, description: &str) -> Operationwhere
T: JsonSchema + ?Sized,
Response status with an application/json body holding a T.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Operation
impl RefUnwindSafe for Operation
impl Send for Operation
impl Sync for Operation
impl Unpin for Operation
impl UnsafeUnpin for Operation
impl UnwindSafe for Operation
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Available on crate feature
map-response-body only.Apply a transformation to the response body. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using gRPC headers. Read more