Trait Route

Source
pub trait Route<Req: Request, Resp: Response> {
    // Required methods
    fn get(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self;
    fn post(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self;
    fn put(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self;
    fn delete(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self;
    fn serve_dir(&mut self, dir: impl AsRef<Path>) -> HttpResult<&mut Self>;
    fn serve_file(&mut self, file: impl AsRef<Path>) -> HttpResult<&mut Self>;
}

Required Methods§

Source

fn get(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self

Source

fn post(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self

Source

fn put(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self

Source

fn delete(&mut self, ep: impl Endpoint<Req, Resp>) -> &mut Self

Source

fn serve_dir(&mut self, dir: impl AsRef<Path>) -> HttpResult<&mut Self>

Source

fn serve_file(&mut self, file: impl AsRef<Path>) -> HttpResult<&mut Self>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§