pub struct ProductOSRouter<S = ()> { /* private fields */ }
Implementations§
Source§impl ProductOSRouter<()>
impl ProductOSRouter<()>
pub fn new() -> Self
pub fn param_to_field(path: &str) -> String
pub fn add_service_no_state<Z>(&mut self, path: &str, service: Z)
pub fn add_middleware_no_state<L>(&mut self, middleware: L)where
L: Layer<Route> + Clone + Send + Sync + 'static,
L::Service: Service<Request<Body>> + Clone + Send + Sync + 'static,
<L::Service as Service<Request<Body>>>::Future: Send + 'static,
<L::Service as Service<Request<Body>>>::Error: Into<BoxError> + 'static,
<L::Service as Service<Request<Body>>>::Response: IntoResponse + 'static,
pub fn add_default_header_no_state( &mut self, header_name: &str, header_value: &str, )
pub fn not_implemented() -> Response<Body>
pub fn add_route_no_state(&mut self, path: &str, service_handler: MethodRouter)
pub fn set_fallback_no_state(&mut self, service_handler: MethodRouter)
pub fn add_get_no_state<H, T>(&mut self, path: &str, handler: H)
pub fn add_post_no_state<H, T>(&mut self, path: &str, handler: H)
pub fn add_handler_no_state<H, T>( &mut self, path: &str, method: Method, handler: H, )
pub fn set_fallback_handler_no_state<H, T>(&mut self, handler: H)
pub fn add_handlers_no_state<H, T>( &mut self, path: &str, handlers: BTreeMap<Method, H>, )
Source§impl<S> ProductOSRouter<S>
impl<S> ProductOSRouter<S>
pub fn get_router(&self) -> Router
pub fn get_router_mut(&mut self) -> &mut Router<S>
pub fn new_with_state(state: S) -> Self
pub fn add_service<Z>(&mut self, path: &str, service: Z)
pub fn add_middleware<L>(&mut self, middleware: L)where
L: Layer<Route> + Clone + Send + Sync + 'static,
L::Service: Service<Request<Body>> + Clone + Send + Sync + 'static,
<L::Service as Service<Request<Body>>>::Future: Send + 'static,
<L::Service as Service<Request<Body>>>::Error: Into<BoxError> + 'static,
<L::Service as Service<Request<Body>>>::Response: IntoResponse + 'static,
pub fn add_default_header(&mut self, header_name: String, header_value: String)
pub fn add_route(&mut self, path: &str, service_handler: MethodRouter<S>)
pub fn set_fallback(&mut self, service_handler: MethodRouter<S>)
pub fn add_get<H, T>(&mut self, path: &str, handler: H)where
H: Handler<T, S>,
T: 'static,
pub fn add_post<H, T>(&mut self, path: &str, handler: H)where
H: Handler<T, S>,
T: 'static,
pub fn add_handler<H, T>(&mut self, path: &str, method: Method, handler: H)where
H: Handler<T, S>,
T: 'static,
pub fn add_state(&mut self, state: S)
pub fn set_fallback_handler<H, T>(&mut self, handler: H)where
H: Handler<T, S>,
T: 'static,
pub fn add_handlers<H, T>(&mut self, path: &str, handlers: BTreeMap<Method, H>)where
H: Handler<T, S>,
T: 'static,
Auto Trait Implementations§
impl<S> Freeze for ProductOSRouter<S>where
S: Freeze,
impl<S = ()> !RefUnwindSafe for ProductOSRouter<S>
impl<S> Send for ProductOSRouter<S>where
S: Send,
impl<S> Sync for ProductOSRouter<S>where
S: Sync,
impl<S> Unpin for ProductOSRouter<S>where
S: Unpin,
impl<S = ()> !UnwindSafe for ProductOSRouter<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more