Trait aide::operation::OperationInput

source ·
pub trait OperationInput {
    // Provided methods
    fn operation_input(ctx: &mut GenContext, operation: &mut Operation) { ... }
    fn inferred_early_responses(
        ctx: &mut GenContext,
        operation: &mut Operation
    ) -> Vec<(Option<u16>, Response)> { ... }
}
Expand description

A trait for operation input schema generation.

This must be implemented for all extractors that appear in documented handlers.

All method implementations are optional.

§Examples

In order to allow an extractor to appear in a handler, the following is enough:

use aide::OperationInput;

struct MyExtractor;

impl OperationInput for MyExtractor {}

This will enable usage of the extractor in handlers, but will not add anything to the documentation. To extend the generated documentation refer to some of the provided implementations in this crate.

For simpler cases or wrappers the OperationIo derive macro can be used to implement this trait.

Provided Methods§

source

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

Modify the operation.

This method gets mutable access to the entire operation, it’s the implementer’s responsibility to detect errors and only modify the operation as much as needed.

There are reusable helpers in aide::operation to help with both boilerplate and error detection.

source

fn inferred_early_responses( ctx: &mut GenContext, operation: &mut Operation ) -> Vec<(Option<u16>, Response)>

Inferred early responses are used to document early returns for extractors, guards inside handlers. For example these could represent JSON parsing errors, authentication failures.

The function is supposed to return (status code, response) pairs, if the status code is not specified, the response is assumed to be a default response.

It’s important for the implementation to be idempotent.

See OperationOutput::inferred_responses for more details.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl OperationInput for ()

source§

impl OperationInput for String

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl OperationInput for Vec<u8>

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl OperationInput for Body

Available on crate feature axum only.
source§

impl OperationInput for PrivateCookieJar

Available on crate features axum-extra and axum and axum-extra-cookie-private only.
source§

impl OperationInput for CookieJar

Available on crate features axum-extra and axum and axum-extra-cookie only.
source§

impl OperationInput for Host

Available on crate feature axum only.
source§

impl OperationInput for MatchedPath

Available on crate feature axum only.
source§

impl OperationInput for Multipart

Available on crate features axum and axum-multipart only.
source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl OperationInput for RawQuery

Available on crate feature axum only.
source§

impl OperationInput for OriginalUri

Available on crate feature axum only.
source§

impl OperationInput for WebSocketUpgrade

Available on crate features axum and axum-ws only.
source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl OperationInput for Bytes

Available on crate feature bytes only.
source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl OperationInput for BytesMut

Available on crate feature bytes only.
source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl OperationInput for HeaderMap

Available on crate feature http only.
source§

impl OperationInput for Method

Available on crate feature http only.
source§

impl OperationInput for Parts

Available on crate feature http only.
source§

impl OperationInput for Uri

Available on crate feature http only.
source§

impl OperationInput for Version

Available on crate feature http only.
source§

impl<'a> OperationInput for &'a [u8]

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<'a> OperationInput for Cow<'a, [u8]>

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<B> OperationInput for Request<B>

Available on crate feature http only.
source§

impl<T1> OperationInput for (T1,)
where T1: OperationInput,

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T1, T2> OperationInput for (T1, T2)

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T1, T2, T3> OperationInput for (T1, T2, T3)

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T1, T2, T3, T4> OperationInput for (T1, T2, T3, T4)

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T1, T2, T3, T4, T5> OperationInput for (T1, T2, T3, T4, T5)

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T1, T2, T3, T4, T5, T6> OperationInput for (T1, T2, T3, T4, T5, T6)

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T1, T2, T3, T4, T5, T6, T7> OperationInput for (T1, T2, T3, T4, T5, T6, T7)

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> OperationInput for (T1, T2, T3, T4, T5, T6, T7, T8)

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9> OperationInput for (T1, T2, T3, T4, T5, T6, T7, T8, T9)

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> OperationInput for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> OperationInput for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> OperationInput for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> OperationInput for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> OperationInput for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> OperationInput for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> OperationInput for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T> OperationInput for Option<T>
where T: OperationInput,

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T> OperationInput for Box<T>
where T: OperationInput,

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T> OperationInput for Rc<T>
where T: OperationInput,

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T> OperationInput for Arc<T>
where T: OperationInput,

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T> OperationInput for Cached<T>
where T: OperationInput,

Available on crate features axum-extra and axum only.
source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T> OperationInput for Form<T>
where T: JsonSchema,

Available on crate features axum-extra and axum and axum-extra-form only.
source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T> OperationInput for Query<T>
where T: JsonSchema,

Available on crate features axum-extra and axum and axum-extra-query only.
source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T> OperationInput for TypedHeader<T>
where T: Header,

Available on crate features axum and axum-headers only.
source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T> OperationInput for Extension<T>

Available on crate feature axum only.
source§

impl<T> OperationInput for Path<T>
where T: JsonSchema,

Available on crate feature axum only.
source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T> OperationInput for Query<T>
where T: JsonSchema,

Available on crate feature axum only.
source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T> OperationInput for State<T>

Available on crate feature axum only.
source§

impl<T> OperationInput for Form<T>
where T: JsonSchema,

Available on crate feature axum only.
source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T> OperationInput for Json<T>
where T: JsonSchema,

Available on crate feature axum only.
source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T> OperationInput for JwtClaims<T>

Available on crate features jwt-authorizer and axum only.
source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T> OperationInput for QsQuery<T>
where T: JsonSchema,

Available on crate features serde_qs and axum only.
source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

impl<T, E> OperationInput for Result<T, E>
where T: OperationInput,

source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

source§

fn inferred_early_responses( ctx: &mut GenContext, operation: &mut Operation ) -> Vec<(Option<u16>, Response)>

source§

impl<T, R> OperationInput for WithRejection<T, R>
where T: OperationInput,

Available on crate features axum-extra and axum only.
source§

fn operation_input(ctx: &mut GenContext, operation: &mut Operation)

Implementors§