Struct arc_reactor::ArcReactor [] [src]

pub struct ArcReactor { /* fields omitted */ }

The main server, the ArcReactor is where you mount your routes, middlewares and initiate the server.

#Examples

This example is not tested
extern crate arc_reactor;
use arc_reactor::ArcReactor;

fn main() {
  ArcReactor::new().routes(..).port(1234).initiate().unwrap()
}

Methods

impl ArcReactor
[src]

[src]

Creates an instance of the server. with a default port of 8080 and No routes. Note that calling initiate on an ArcReactor without routes will cause your program to panic.

[src]

sets the port for the server to listen on and returns the instance.

[src]

mount the Router on the ArcReactor

[src]

Binds the listener and blocks the main thread while listening for incoming connections.

Panics

Calling this function will panic if: no routes are supplied, or it cannot start the main event loop.

Trait Implementations

Auto Trait Implementations

impl Send for ArcReactor

impl Sync for ArcReactor