Struct libracerd::http::Server [] [src]

pub struct Server {
    // some fields omitted
}

Wrapper type with information and control of the underlying HTTP server

This type can only be created via the serve function.

Methods

impl Server

fn close(&mut self) -> Result<()>

Stop accepting connections

fn addr(&self) -> String

Get listening address of server (eg. "127.0.0.1:59369")

Example

let mut config = ::libracerd::Config::new();
config.port = 3000;

let engine = ::libracerd::engine::Racer::new();
let server = ::libracerd::http::serve(&config, engine).unwrap();

assert_eq!(server.addr(), "0.0.0.0:3000");

Trait Implementations

Derived Implementations

impl Debug for Server

fn fmt(&self, __arg_0: &mut Formatter) -> Result