Struct product_os_server::ProductOSRouter
source · pub struct ProductOSRouter<S = ()> { /* private fields */ }Implementations§
source§impl<S> ProductOSRouter<S>where
S: Clone + Send + Sync + 'static,
impl<S> ProductOSRouter<S>where S: Clone + Send + Sync + 'static,
pub fn new(state: S) -> ProductOSRouter<S>where S: Clone + Send + Sync + 'static,
pub fn add_route(&mut self, path: &str, service_handler: MethodRouter<S>)where S: Clone + Send + Sync + 'static,
pub fn set_fallback(&mut self, service_handler: MethodRouter<S>)where S: Clone + Send + Sync + 'static,
pub fn add_service<Z>(&mut self, path: &str, service: Z)where Z: Service<Request<Body>, Response = Response<UnsyncBoxBody<Bytes, Error>>, Error = Infallible> + Clone + Send + 'static, <Z as Service<Request<Body>>>::Future: Send + 'static,
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: HashMap<Method, H>)where H: Handler<T, S>, T: 'static,
pub fn add_middleware<L, NewResBody>(&mut self, middleware: L)where L: Layer<Route> + Clone + Send + 'static, <L as Layer<Route>>::Service: Service<Request<Body>, Response = Response<NewResBody>, Error = Infallible> + Clone + Send + 'static, <<L as Layer<Route>>::Service as Service<Request<Body>>>::Future: Send + 'static, NewResBody: Body<Data = Bytes> + Send + 'static, <NewResBody as Body>::Error: Into<Box<dyn Error + Send + Sync>>,
pub fn add_default_header(&mut self, header_name: String, header_value: String)
pub fn get_router(&mut self) -> Router
pub fn not_implemented() -> Response<Body>
Auto Trait Implementations§
impl<S = ()> !RefUnwindSafe for ProductOSRouter<S>
impl<S> Send for ProductOSRouter<S>where S: Send,
impl<S = ()> !Sync for ProductOSRouter<S>
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