pub struct App { /* private fields */ }Implementations§
Source§impl App
impl App
pub fn new() -> Self
pub fn config(self, cfg: Config) -> Self
pub fn state<T: Clone + Send + Sync + 'static>(self, val: T) -> Self
pub fn route<F, Fut>(self, method: &str, path: &str, handler: F) -> Self
pub fn mount_routes(self) -> Self
pub fn with<M: Middleware>(self, m: M) -> Self
Sourcepub fn init_tracing()
pub fn init_tracing()
Initialise tracing to stdout — call before listen
pub async fn listen(self, addr: &str)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for App
impl !UnwindSafe for App
impl Freeze for App
impl Send for App
impl Sync for App
impl Unpin for App
impl UnsafeUnpin 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