Skip to main content

RouteControllerExt

Trait RouteControllerExt 

Source
pub trait RouteControllerExt: RouteController {
Show 29 methods // Provided methods fn mount_get<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_post<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_put<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_patch<T, F, Fut>( &self, router: &mut Router, path: &str, has_body: bool, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_patch_with_body<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_patch_without_body<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_delete<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_options<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_head<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_trace<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_connect<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_copy<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_move<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_lock<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_unlock<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_propfind<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_mkcol<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_search<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_report<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_checkin<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_checkout<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_uncheckout<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_merge<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_acl<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_custom<T, F, Fut>( &self, router: &mut Router, path: &str, method: Method, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static { ... } fn mount_static( &self, router: &mut Router, path: &str, fs_path: String, middlewares: Vec<Middleware>, ) { ... } fn mount_typed<F, Fut>( &self, router: &mut Router, path: &str, method: Method, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<Box<dyn TypedServiceResult>, ErrorResult>> + Send + 'static { ... } fn mount_get_typed<F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<Box<dyn TypedServiceResult>, ErrorResult>> + Send + 'static { ... } fn mount_post_typed<F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, ) where F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<Box<dyn TypedServiceResult>, ErrorResult>> + Send + 'static { ... }
}
Expand description

Convenience mounts that fill in this controller’s base path and version. Each mount_* takes an Fn(CorrelationContext) handler returning Result<ServiceResult<T>, ErrorResult>; the *_typed variants instead return Result<Box<dyn TypedServiceResult>, ErrorResult> for heterogeneous payloads.

self.mount_get(&mut router, "/list", desc, handler, vec![]);

Provided Methods§

Source

fn mount_get<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a GET handler with no required body at path.

Source

fn mount_post<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a POST handler; requires a declared request body or file parameter.

Source

fn mount_put<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a PUT handler; requires a declared request body or file parameter.

Source

fn mount_patch<T, F, Fut>( &self, router: &mut Router, path: &str, has_body: bool, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a PATCH handler; has_body selects whether a request body is required.

Source

fn mount_patch_with_body<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a PATCH handler that requires a request body.

Source

fn mount_patch_without_body<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a PATCH handler that requires no request body.

Source

fn mount_delete<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a DELETE handler with no required body at path.

Source

fn mount_options<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts an OPTIONS handler with no required body at path.

Source

fn mount_head<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a HEAD handler with no required body at path.

Source

fn mount_trace<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a TRACE handler with no required body at path.

Source

fn mount_connect<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a CONNECT handler with no required body at path.

Source

fn mount_copy<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a WebDAV COPY handler with no required body at path.

Source

fn mount_move<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a WebDAV MOVE handler with no required body at path.

Source

fn mount_lock<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a WebDAV LOCK handler; requires a declared request body or file parameter.

Source

fn mount_unlock<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a WebDAV UNLOCK handler with no required body at path.

Source

fn mount_propfind<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a WebDAV PROPFIND handler; requires a declared request body or file parameter.

Source

fn mount_mkcol<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a WebDAV MKCOL handler with no required body at path.

Mounts a WebDAV SEARCH handler; requires a declared request body or file parameter.

Source

fn mount_report<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a WebDAV REPORT handler; requires a declared request body or file parameter.

Source

fn mount_checkin<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a versioning CHECKIN handler with no required body at path.

Source

fn mount_checkout<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a versioning CHECKOUT handler with no required body at path.

Source

fn mount_uncheckout<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a versioning UNCHECKOUT handler with no required body at path.

Source

fn mount_merge<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a WebDAV MERGE handler; requires a declared request body or file parameter.

Source

fn mount_acl<T, F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a WebDAV ACL handler; requires a declared request body or file parameter.

Source

fn mount_custom<T, F, Fut>( &self, router: &mut Router, path: &str, method: Method, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where T: Serialize + Send + Sync + 'static, F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<ServiceResult<T>, ErrorResult>> + Send + 'static,

Mounts a handler for an arbitrary method with no required body at path.

Source

fn mount_static( &self, router: &mut Router, path: &str, fs_path: String, middlewares: Vec<Middleware>, )

Serves files under fs_path at this controller’s base path plus path.

Source

fn mount_typed<F, Fut>( &self, router: &mut Router, path: &str, method: Method, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<Box<dyn TypedServiceResult>, ErrorResult>> + Send + 'static,

Mounts a handler returning Box<dyn TypedServiceResult> for heterogeneous payloads.

Source

fn mount_get_typed<F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<Box<dyn TypedServiceResult>, ErrorResult>> + Send + 'static,

Mounts a boxed-result GET handler returning heterogeneous payloads.

Source

fn mount_post_typed<F, Fut>( &self, router: &mut Router, path: &str, description: RouteDescription, handler: F, middlewares: Vec<Middleware>, )
where F: Fn(CorrelationContext) -> Fut + Send + Sync + 'static, Fut: Future<Output = Result<Box<dyn TypedServiceResult>, ErrorResult>> + Send + 'static,

Mounts a boxed-result POST handler returning heterogeneous payloads.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§