Struct aide::axum::routing::ApiMethodRouter
source · pub struct ApiMethodRouter<S = (), E = Infallible> { /* private fields */ }
axum
only.Expand description
A wrapper over axum::routing::MethodRouter
that adds
API documentation-specific features.
Implementations§
source§impl<S> ApiMethodRouter<S, Infallible>
impl<S> ApiMethodRouter<S, Infallible>
sourcepub fn delete<H, I, O, T>(self, handler: H) -> Self
pub fn delete<H, I, O, T>(self, handler: H) -> Self
Route delete
requests to the given handler. See axum::routing::MethodRouter::delete
for more details.
sourcepub fn delete_with<H, I, O, T, F>(self, handler: H, transform: F) -> Selfwhere
H: Handler<T, S> + OperationHandler<I, O>,
I: OperationInput,
O: OperationOutput,
T: 'static,
F: FnOnce(TransformOperation<'_>) -> TransformOperation<'_>,
pub fn delete_with<H, I, O, T, F>(self, handler: H, transform: F) -> Selfwhere
H: Handler<T, S> + OperationHandler<I, O>,
I: OperationInput,
O: OperationOutput,
T: 'static,
F: FnOnce(TransformOperation<'_>) -> TransformOperation<'_>,
Route delete
requests to the given handler. See axum::routing::MethodRouter::delete
for more details.
This method additionally accepts a transform function,
see crate::axum
for more details.
sourcepub fn get<H, I, O, T>(self, handler: H) -> Self
pub fn get<H, I, O, T>(self, handler: H) -> Self
Route get
requests to the given handler. See axum::routing::MethodRouter::get
for more details.
sourcepub fn get_with<H, I, O, T, F>(self, handler: H, transform: F) -> Selfwhere
H: Handler<T, S> + OperationHandler<I, O>,
I: OperationInput,
O: OperationOutput,
T: 'static,
F: FnOnce(TransformOperation<'_>) -> TransformOperation<'_>,
pub fn get_with<H, I, O, T, F>(self, handler: H, transform: F) -> Selfwhere
H: Handler<T, S> + OperationHandler<I, O>,
I: OperationInput,
O: OperationOutput,
T: 'static,
F: FnOnce(TransformOperation<'_>) -> TransformOperation<'_>,
Route get
requests to the given handler. See axum::routing::MethodRouter::get
for more details.
This method additionally accepts a transform function,
see crate::axum
for more details.
sourcepub fn head<H, I, O, T>(self, handler: H) -> Self
pub fn head<H, I, O, T>(self, handler: H) -> Self
Route head
requests to the given handler. See axum::routing::MethodRouter::head
for more details.
sourcepub fn head_with<H, I, O, T, F>(self, handler: H, transform: F) -> Selfwhere
H: Handler<T, S> + OperationHandler<I, O>,
I: OperationInput,
O: OperationOutput,
T: 'static,
F: FnOnce(TransformOperation<'_>) -> TransformOperation<'_>,
pub fn head_with<H, I, O, T, F>(self, handler: H, transform: F) -> Selfwhere
H: Handler<T, S> + OperationHandler<I, O>,
I: OperationInput,
O: OperationOutput,
T: 'static,
F: FnOnce(TransformOperation<'_>) -> TransformOperation<'_>,
Route head
requests to the given handler. See axum::routing::MethodRouter::head
for more details.
This method additionally accepts a transform function,
see crate::axum
for more details.
sourcepub fn options<H, I, O, T>(self, handler: H) -> Self
pub fn options<H, I, O, T>(self, handler: H) -> Self
Route options
requests to the given handler. See axum::routing::MethodRouter::options
for more details.
sourcepub fn options_with<H, I, O, T, F>(self, handler: H, transform: F) -> Selfwhere
H: Handler<T, S> + OperationHandler<I, O>,
I: OperationInput,
O: OperationOutput,
T: 'static,
F: FnOnce(TransformOperation<'_>) -> TransformOperation<'_>,
pub fn options_with<H, I, O, T, F>(self, handler: H, transform: F) -> Selfwhere
H: Handler<T, S> + OperationHandler<I, O>,
I: OperationInput,
O: OperationOutput,
T: 'static,
F: FnOnce(TransformOperation<'_>) -> TransformOperation<'_>,
Route options
requests to the given handler. See axum::routing::MethodRouter::options
for more details.
This method additionally accepts a transform function,
see crate::axum
for more details.
sourcepub fn patch<H, I, O, T>(self, handler: H) -> Self
pub fn patch<H, I, O, T>(self, handler: H) -> Self
Route patch
requests to the given handler. See axum::routing::MethodRouter::patch
for more details.
sourcepub fn patch_with<H, I, O, T, F>(self, handler: H, transform: F) -> Selfwhere
H: Handler<T, S> + OperationHandler<I, O>,
I: OperationInput,
O: OperationOutput,
T: 'static,
F: FnOnce(TransformOperation<'_>) -> TransformOperation<'_>,
pub fn patch_with<H, I, O, T, F>(self, handler: H, transform: F) -> Selfwhere
H: Handler<T, S> + OperationHandler<I, O>,
I: OperationInput,
O: OperationOutput,
T: 'static,
F: FnOnce(TransformOperation<'_>) -> TransformOperation<'_>,
Route patch
requests to the given handler. See axum::routing::MethodRouter::patch
for more details.
This method additionally accepts a transform function,
see crate::axum
for more details.
sourcepub fn post<H, I, O, T>(self, handler: H) -> Self
pub fn post<H, I, O, T>(self, handler: H) -> Self
Route post
requests to the given handler. See axum::routing::MethodRouter::post
for more details.
sourcepub fn post_with<H, I, O, T, F>(self, handler: H, transform: F) -> Selfwhere
H: Handler<T, S> + OperationHandler<I, O>,
I: OperationInput,
O: OperationOutput,
T: 'static,
F: FnOnce(TransformOperation<'_>) -> TransformOperation<'_>,
pub fn post_with<H, I, O, T, F>(self, handler: H, transform: F) -> Selfwhere
H: Handler<T, S> + OperationHandler<I, O>,
I: OperationInput,
O: OperationOutput,
T: 'static,
F: FnOnce(TransformOperation<'_>) -> TransformOperation<'_>,
Route post
requests to the given handler. See axum::routing::MethodRouter::post
for more details.
This method additionally accepts a transform function,
see crate::axum
for more details.
sourcepub fn put<H, I, O, T>(self, handler: H) -> Self
pub fn put<H, I, O, T>(self, handler: H) -> Self
Route put
requests to the given handler. See axum::routing::MethodRouter::put
for more details.
sourcepub fn put_with<H, I, O, T, F>(self, handler: H, transform: F) -> Selfwhere
H: Handler<T, S> + OperationHandler<I, O>,
I: OperationInput,
O: OperationOutput,
T: 'static,
F: FnOnce(TransformOperation<'_>) -> TransformOperation<'_>,
pub fn put_with<H, I, O, T, F>(self, handler: H, transform: F) -> Selfwhere
H: Handler<T, S> + OperationHandler<I, O>,
I: OperationInput,
O: OperationOutput,
T: 'static,
F: FnOnce(TransformOperation<'_>) -> TransformOperation<'_>,
Route put
requests to the given handler. See axum::routing::MethodRouter::put
for more details.
This method additionally accepts a transform function,
see crate::axum
for more details.
sourcepub fn trace<H, I, O, T>(self, handler: H) -> Self
pub fn trace<H, I, O, T>(self, handler: H) -> Self
Route trace
requests to the given handler. See axum::routing::MethodRouter::trace
for more details.
sourcepub fn trace_with<H, I, O, T, F>(self, handler: H, transform: F) -> Selfwhere
H: Handler<T, S> + OperationHandler<I, O>,
I: OperationInput,
O: OperationOutput,
T: 'static,
F: FnOnce(TransformOperation<'_>) -> TransformOperation<'_>,
pub fn trace_with<H, I, O, T, F>(self, handler: H, transform: F) -> Selfwhere
H: Handler<T, S> + OperationHandler<I, O>,
I: OperationInput,
O: OperationOutput,
T: 'static,
F: FnOnce(TransformOperation<'_>) -> TransformOperation<'_>,
Route trace
requests to the given handler. See axum::routing::MethodRouter::trace
for more details.
This method additionally accepts a transform function,
see crate::axum
for more details.
source§impl<S, E> ApiMethodRouter<S, E>where
S: Clone,
impl<S, E> ApiMethodRouter<S, E>where
S: Clone,
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new, empty ApiMethodRouter
based on MethodRouter::new()
.