pub struct App { /* private fields */ }
Implementations§
Source§impl App
impl App
pub fn new() -> App
pub fn with_state<T>(state: T) -> App
pub fn merge( &mut self, prefix: impl AsRef<str>, router: Router, ) -> Result<(), Error>
pub fn register( &mut self, method: Method, path: impl AsRef<str>, ep: impl Endpoint, )
pub fn options(&mut self, path: impl AsRef<str>, ep: impl Endpoint)
pub fn get(&mut self, path: impl AsRef<str>, ep: impl Endpoint)
pub fn head(&mut self, path: impl AsRef<str>, ep: impl Endpoint)
pub fn post(&mut self, path: impl AsRef<str>, ep: impl Endpoint)
pub fn put(&mut self, path: impl AsRef<str>, ep: impl Endpoint)
pub fn delete(&mut self, path: impl AsRef<str>, ep: impl Endpoint)
pub fn trace(&mut self, path: impl AsRef<str>, ep: impl Endpoint)
pub fn connect(&mut self, path: impl AsRef<str>, ep: impl Endpoint)
pub fn patch(&mut self, path: impl AsRef<str>, ep: impl Endpoint)
pub fn middleware(&mut self, m: impl Middleware) -> &mut Self
pub fn handle_not_found(&mut self, ep: impl Endpoint) -> &mut Self
pub async fn respond(self, req: impl Into<Request>) -> Response
pub async fn run(self, addr: impl ToSocketAddrs) -> Result<(), Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for App
impl !RefUnwindSafe for App
impl Send for App
impl Sync for App
impl Unpin for App
impl !UnwindSafe for App
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