[][src]Struct express_rs::Express

pub struct Express { /* fields omitted */ }

Implementations

impl Express[src]

Main application object

Provides ways to mount path and method combinations and assign functions to them.

pub fn new() -> Self[src]

pub fn get<F: 'static>(&mut self, path: &str, callback: F) -> &mut Self where
    F: FnMut(&Request, &mut Response),
    Self: Sized
[src]

pub fn post<F: 'static>(&mut self, path: &str, callback: F) -> &mut Self where
    F: FnMut(&Request, &mut Response),
    Self: Sized
[src]

pub fn put<F: 'static>(&mut self, path: &str, callback: F) -> &mut Self where
    F: FnMut(&Request, &mut Response),
    Self: Sized
[src]

pub fn delete<F: 'static>(&mut self, path: &str, callback: F) -> &mut Self where
    F: FnMut(&Request, &mut Response),
    Self: Sized
[src]

pub fn patch<F: 'static>(&mut self, path: &str, callback: F) -> &mut Self where
    F: FnMut(&Request, &mut Response),
    Self: Sized
[src]

pub fn listen(&mut self, port: u16)[src]

Port numbers can range from 1-65535, therefore a u16 is used here

Panics

Panics, if:

  • a port is not between 1-65535 or
  • address on host is already in use

Auto Trait Implementations

impl !RefUnwindSafe for Express

impl !Send for Express

impl !Sync for Express

impl Unpin for Express

impl !UnwindSafe for Express

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.