TypedApiRouter

Trait TypedApiRouter 

Source
pub trait TypedApiRouter: TypedRouter {
    // Required methods
    fn typed_api_route(
        self,
        handler: fn() -> (&'static str, ApiMethodRouter<Self::State>),
    ) -> Self;
    fn typed_api_route_with(
        self,
        handler: fn() -> (&'static str, ApiMethodRouter<Self::State>),
        transform: impl FnOnce(TransformPathItem<'_>) -> TransformPathItem<'_>,
    ) -> Self;
}
Expand description

Same as TypedRouter, but with support for aide.

Required Methods§

Source

fn typed_api_route( self, handler: fn() -> (&'static str, ApiMethodRouter<Self::State>), ) -> Self

Same as TypedRouter::typed_route, but with support for aide.

Source

fn typed_api_route_with( self, handler: fn() -> (&'static str, ApiMethodRouter<Self::State>), transform: impl FnOnce(TransformPathItem<'_>) -> TransformPathItem<'_>, ) -> Self

Same as TypedApiRouter::typed_api_route, but with a custom path transform for use with aide.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<S> TypedApiRouter for ApiRouter<S>
where S: Send + Sync + Clone + 'static,

Source§

fn typed_api_route( self, handler: fn() -> (&'static str, ApiMethodRouter<Self::State>), ) -> Self

Source§

fn typed_api_route_with( self, handler: fn() -> (&'static str, ApiMethodRouter<Self::State>), transform: impl FnOnce(TransformPathItem<'_>) -> TransformPathItem<'_>, ) -> Self

Implementors§