#[non_exhaustive]pub struct Operation {Show 13 fields
pub tags: Vec<String>,
pub summary: Option<String>,
pub description: Option<String>,
pub operation_id: Option<String>,
pub external_docs: Option<ExternalDocs>,
pub parameters: Parameters,
pub request_body: Option<RequestBody>,
pub responses: Responses,
pub callbacks: Option<String>,
pub deprecated: Option<Deprecated>,
pub securities: Vec<SecurityRequirement>,
pub servers: Servers,
pub extensions: BTreeMap<String, Value>,
}Expand description
Implements OpenAPI Operation Object object.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.List of tags used for grouping operations.
When used with derive #[salvo_oapi::endpoint(...)] attribute macro the default
value used will be resolved from handler path provided in #[openapi(paths(...))] with
#[derive(OpenApi)] macro. If path resolves to None value crate will
be used by default.
summary: Option<String>Short summary what Operation does.
When used with derive #[salvo_oapi::endpoint(...)] attribute macro the value
is taken from first line of doc comment.
description: Option<String>Long explanation of Operation behaviour. Markdown syntax is supported.
When used with derive #[salvo_oapi::endpoint(...)] attribute macro the
doc comment is used as value for description.
operation_id: Option<String>Unique identifier for the API Operation. Most typically this is mapped to handler function name.
When used with derive #[salvo_oapi::endpoint(...)] attribute macro the handler function
name will be used by default.
external_docs: Option<ExternalDocs>Additional external documentation for this operation.
parameters: ParametersList of applicable parameters for this Operation.
request_body: Option<RequestBody>Optional request body for this Operation.
responses: ResponsesList of possible responses returned by the Operation.
callbacks: Option<String>Callback information.
deprecated: Option<Deprecated>Define whether the operation is deprecated or not and thus should be avoided consuming.
securities: Vec<SecurityRequirement>Declaration which security mechanisms can be used for for the operation. Only one
SecurityRequirement must be met.
Security for the Operation can be set to optional by adding empty security with
SecurityRequirement::default.
servers: Servers§extensions: BTreeMap<String, Value>Optional extensions “x-something”
Implementations§
Source§impl Operation
impl Operation
Add or change tags of the Operation.
Sourcepub fn description<S>(self, description: S) -> Operation
pub fn description<S>(self, description: S) -> Operation
Add or change description of the Operation.
Sourcepub fn operation_id<S>(self, operation_id: S) -> Operation
pub fn operation_id<S>(self, operation_id: S) -> Operation
Add or change operation id of the Operation.
Sourcepub fn parameters<I, P>(self, parameters: I) -> Operation
pub fn parameters<I, P>(self, parameters: I) -> Operation
Add or change parameters of the Operation.
Sourcepub fn add_parameter<P>(self, parameter: P) -> Operation
pub fn add_parameter<P>(self, parameter: P) -> Operation
Append parameter to Operation parameters and returns Self.
Sourcepub fn request_body(self, request_body: RequestBody) -> Operation
pub fn request_body(self, request_body: RequestBody) -> Operation
Add or change request body of the Operation.
Sourcepub fn add_response<S, R>(self, code: S, response: R) -> Operation
pub fn add_response<S, R>(self, code: S, response: R) -> Operation
Sourcepub fn deprecated<D>(self, deprecated: D) -> Operationwhere
D: Into<Deprecated>,
pub fn deprecated<D>(self, deprecated: D) -> Operationwhere
D: Into<Deprecated>,
Add or change deprecated status of the Operation.
Sourcepub fn securities<I>(self, securities: I) -> Operationwhere
I: IntoIterator<Item = SecurityRequirement>,
pub fn securities<I>(self, securities: I) -> Operationwhere
I: IntoIterator<Item = SecurityRequirement>,
Add or change list of SecurityRequirements that are available for Operation.
Sourcepub fn add_security(self, security: SecurityRequirement) -> Operation
pub fn add_security(self, security: SecurityRequirement) -> Operation
Append SecurityRequirement to Operation security requirements and returns Self.
Sourcepub fn servers<I>(self, servers: I) -> Operationwhere
I: IntoIterator<Item = Server>,
pub fn servers<I>(self, servers: I) -> Operationwhere
I: IntoIterator<Item = Server>,
Sourcepub fn add_server(self, server: Server) -> Operation
pub fn add_server(self, server: Server) -> Operation
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Operation
impl<'de> Deserialize<'de> for Operation
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Operation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Operation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Operation
impl Serialize for Operation
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Operation
Auto Trait Implementations§
impl Freeze for Operation
impl RefUnwindSafe for Operation
impl Send for Operation
impl Sync for Operation
impl Unpin for Operation
impl UnwindSafe for Operation
Blanket Implementations§
Source§impl<Data> ApiSuccessResponse for Data
impl<Data> ApiSuccessResponse for Data
fn api_response<Meta>(self, meta: Option<Meta>) -> ApiResponse<Self, Meta>
fn api_response_without_meta<Meta>(self) -> ApiResponse<Self, Meta>
fn api_response_with_meta<Meta>(self, meta: Meta) -> ApiResponse<Self, Meta>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> FutureTraceExt for Twhere
T: FutureExt,
impl<T> FutureTraceExt for Twhere
T: FutureExt,
Source§fn with_current_context_span(self, otel_span: Span) -> WithContext<Self> ⓘ
fn with_current_context_span(self, otel_span: Span) -> WithContext<Self> ⓘ
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> ⓘ
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> ⓘ
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request