Struct milstian_internet_framework::Application[][src]

pub struct Application;

Main entry point for a new application.

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

TCP/IP HTTP static application:

use milstian_internet_framework::{Application, Config};
Application::tcp_http_with_legacy_responders(Config::from_env());

Methods

impl Application
[src]

Create a new TCP/IP 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()),
    ];
    Application::tcp_http(Config::from_env(), responders);
}

Create a new TCP/IP HTTP application with the legacy responders

Example

extern crate milstian_internet_framework;
use milstian_internet_framework::{Application, Config};
fn main() {
    Application::tcp_http_with_legacy_responders(Config::from_env());
}

Create a new TCP/IP with legacy and a custom responder

Auto Trait Implementations

impl Send for Application

impl Sync for Application