pub struct Server { /* private fields */ }Expand description
Compiled app ready to handle requests without recompiling the router.
Implementations§
Source§impl Server
impl Server
Sourcepub async fn handle(&self, req: Request) -> Response
pub async fn handle(&self, req: Request) -> Response
Handle a request (tests / embedded). Injects router state.
Sourcepub async fn handle_request(
&self,
method: Method,
path: &str,
body: &str,
) -> Response
pub async fn handle_request( &self, method: Method, path: &str, body: &str, ) -> Response
Convenience for unit tests without headers.
Custom headers: Request::builder + Self::handle.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Server
impl !UnwindSafe for Server
impl Freeze for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin for Server
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