pub struct Router { /* private fields */ }Implementations§
Source§impl Router
impl Router
pub fn new() -> Self
pub fn get<H, Args>(&mut self, path: &str, handler: H)
pub fn post<H, Args>(&mut self, path: &str, handler: H)
pub fn put<H, Args>(&mut self, path: &str, handler: H)
pub fn delete<H, Args>(&mut self, path: &str, handler: H)
pub fn patch<H, Args>(&mut self, path: &str, handler: H)
pub async fn handle(&self, req: OxiditeRequest) -> Result<OxiditeResponse>
Trait Implementations§
Source§impl Service<Request<BoxBody<Bytes, Error>>> for Router
impl Service<Request<BoxBody<Bytes, Error>>> for Router
Source§type Response = OxiditeResponse
type Response = OxiditeResponse
Responses given by the service.
Source§type Future = Pin<Box<dyn Future<Output = Result<<Router as Service<Request<BoxBody<Bytes, Error>>>>::Response, Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<<Router as Service<Request<BoxBody<Bytes, Error>>>>::Response, Error>> + Send>>
The future response value.
Auto Trait Implementations§
impl Freeze for Router
impl !RefUnwindSafe for Router
impl Send for Router
impl Sync for Router
impl Unpin for Router
impl !UnwindSafe for Router
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