Struct milstian_internet_framework::Application[][src]

pub struct Application { /* fields omitted */ }

Main entry point for a new application.

Could in the future support multiple transport layers and application layers.

TCP HTTP static application:

use milstian_internet_framework::{Application, Config};
let config = Config::from_env().expect("Failed to get configuration from environment");
Application::new(config).tcp_http_with_legacy_responders();

Methods

impl Application
[src]

Create a new TCP HTTP application

Example

extern crate milstian_internet_framework;
use milstian_internet_framework::{Application, Config};
use milstian_internet_framework::response::tcp::http::{error, file_not_found, filesystem, ResponderInterface};
fn main() {
    let responders: Vec<Box<ResponderInterface + Send>> = vec![
        Box::new(filesystem::Responder::new()),
        Box::new(error::Responder::new()),
    ];
    let config = Config::from_env().expect("Failed to get configuration from environment");
    Application::new(config).tcp_http(responders);
}

Create a new TCP HTTP application with the legacy responders

Example

extern crate milstian_internet_framework;
use milstian_internet_framework::{Application, Config};
fn main() {
    let config = Config::from_env().expect("Failed to get configuration from environment");
    Application::new(config).tcp_http_with_legacy_responders();
}

Create a new TCP with legacy and a custom responder

use milstian_internet_framework::{Application, Config};
fn main() {
    let config = Config::from_env().expect("Failed to get configuration from environment");
    Application::new(config).tcp_http_with_legacy_responders();
}

Trait Implementations

impl Clone for Application
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Application
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Application

impl Sync for Application