Struct arc_reactor::core::ArcReactor[][src]

pub struct ArcReactor { /* fields omitted */ }

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

#Examples

extern crate arc_reactor;
extern crate tokio;
use arc_reactor::core::ArcReactor;

fn main() {
    let server = ArcReactor::default()
        .port(1234)
        .start()
        .expect("couldn't start server");
    tokio::run(server);
}

Methods

impl ArcReactor
[src]

Creates an instance of the server. with a default port of 8080

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

set the TlsAcceptor check the examples folder for more info.

Mounts the Router on the ArcReactor.

Binds the listener and returns a future representing the server this future should be spawned on the tokio runtime.

Panics

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

Trait Implementations

impl Default for ArcReactor
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl Send for ArcReactor

impl Sync for ArcReactor