Struct aide::axum::routing::ApiMethodRouter

source ·
pub struct ApiMethodRouter<S = (), E = Infallible> { /* private fields */ }
Available on crate feature axum only.
Expand description

A wrapper over axum::routing::MethodRouter that adds API documentation-specific features.

Implementations§

source§

impl<S> ApiMethodRouter<S, Infallible>
where S: Clone + Send + Sync + 'static,

source

pub fn delete<H, I, O, T>(self, handler: H) -> Self
where H: Handler<T, S> + OperationHandler<I, O>, I: OperationInput, O: OperationOutput, T: 'static,

Route delete requests to the given handler. See axum::routing::MethodRouter::delete for more details.

source

pub fn delete_with<H, I, O, T, F>(self, handler: H, transform: F) -> Self
where 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.

source

pub fn get<H, I, O, T>(self, handler: H) -> Self
where H: Handler<T, S> + OperationHandler<I, O>, I: OperationInput, O: OperationOutput, T: 'static,

Route get requests to the given handler. See axum::routing::MethodRouter::get for more details.

source

pub fn get_with<H, I, O, T, F>(self, handler: H, transform: F) -> Self
where 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.

source

pub fn head<H, I, O, T>(self, handler: H) -> Self
where H: Handler<T, S> + OperationHandler<I, O>, I: OperationInput, O: OperationOutput, T: 'static,

Route head requests to the given handler. See axum::routing::MethodRouter::head for more details.

source

pub fn head_with<H, I, O, T, F>(self, handler: H, transform: F) -> Self
where 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.

source

pub fn options<H, I, O, T>(self, handler: H) -> Self
where H: Handler<T, S> + OperationHandler<I, O>, I: OperationInput, O: OperationOutput, T: 'static,

Route options requests to the given handler. See axum::routing::MethodRouter::options for more details.

source

pub fn options_with<H, I, O, T, F>(self, handler: H, transform: F) -> Self
where 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.

source

pub fn patch<H, I, O, T>(self, handler: H) -> Self
where H: Handler<T, S> + OperationHandler<I, O>, I: OperationInput, O: OperationOutput, T: 'static,

Route patch requests to the given handler. See axum::routing::MethodRouter::patch for more details.

source

pub fn patch_with<H, I, O, T, F>(self, handler: H, transform: F) -> Self
where 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.

source

pub fn post<H, I, O, T>(self, handler: H) -> Self
where H: Handler<T, S> + OperationHandler<I, O>, I: OperationInput, O: OperationOutput, T: 'static,

Route post requests to the given handler. See axum::routing::MethodRouter::post for more details.

source

pub fn post_with<H, I, O, T, F>(self, handler: H, transform: F) -> Self
where 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.

source

pub fn put<H, I, O, T>(self, handler: H) -> Self
where H: Handler<T, S> + OperationHandler<I, O>, I: OperationInput, O: OperationOutput, T: 'static,

Route put requests to the given handler. See axum::routing::MethodRouter::put for more details.

source

pub fn put_with<H, I, O, T, F>(self, handler: H, transform: F) -> Self
where 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.

source

pub fn trace<H, I, O, T>(self, handler: H) -> Self
where H: Handler<T, S> + OperationHandler<I, O>, I: OperationInput, O: OperationOutput, T: 'static,

Route trace requests to the given handler. See axum::routing::MethodRouter::trace for more details.

source

pub fn trace_with<H, I, O, T, F>(self, handler: H, transform: F) -> Self
where 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,

source

pub fn new() -> Self

Create a new, empty ApiMethodRouter based on MethodRouter::new().

source

pub fn merge<M>(self, other: M) -> Self
where M: Into<ApiMethodRouter<S, E>>,

source

pub fn layer<L, NewError>(self, layer: L) -> ApiMethodRouter<S, NewError>
where L: Layer<Route<E>> + Clone + Send + 'static, L::Service: Service<Request<Body>> + Clone + Send + 'static, <L::Service as Service<Request<Body>>>::Response: IntoResponse + 'static, <L::Service as Service<Request<Body>>>::Error: Into<NewError> + 'static, <L::Service as Service<Request<Body>>>::Future: Send + 'static, E: 'static, S: 'static, NewError: 'static,

source

pub fn with_state<S2>(self, state: S) -> ApiMethodRouter<S2, E>

source

pub fn on_service<T>(self, filter: MethodFilter, svc: T) -> Self
where T: Service<Request<Body>, Error = E> + Clone + Send + 'static, T::Response: IntoResponse + 'static, T::Future: Send + 'static,

source

pub fn fallback_service<T>(self, svc: T) -> Self
where T: Service<Request<Body>, Error = E> + Clone + Send + 'static, T::Response: IntoResponse + 'static, T::Future: Send + 'static,

source

pub fn route_layer<L>(self, layer: L) -> ApiMethodRouter<S, E>
where L: Layer<Route<E>> + Clone + Send + 'static, L::Service: Service<Request<Body>, Error = E> + Clone + Send + 'static, <L::Service as Service<Request<Body>>>::Response: IntoResponse + 'static, <L::Service as Service<Request<Body>>>::Future: Send + 'static, E: 'static, S: 'static,

Trait Implementations§

source§

impl<S, E> Clone for ApiMethodRouter<S, E>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<S, E> Default for ApiMethodRouter<S, E>
where S: Clone,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<S, E> From<ApiMethodRouter<S, E>> for MethodRouter<S, E>

source§

fn from(router: ApiMethodRouter<S, E>) -> Self

Converts to this type from the input type.
source§

impl<S, E> From<MethodRouter<S, E>> for ApiMethodRouter<S, E>

source§

fn from(router: MethodRouter<S, E>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<S = (), E = Infallible> !Freeze for ApiMethodRouter<S, E>

§

impl<S, E> RefUnwindSafe for ApiMethodRouter<S, E>

§

impl<S, E> Send for ApiMethodRouter<S, E>

§

impl<S, E> Sync for ApiMethodRouter<S, E>

§

impl<S, E> Unpin for ApiMethodRouter<S, E>

§

impl<S, E> UnwindSafe for ApiMethodRouter<S, E>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromRef<T> for T
where T: Clone,

source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,