[][src]Struct milstian_internet_framework::transport_layer::TCP

pub struct TCP {}

Methods

impl TCP[src]

pub fn http(
    application: &Application,
    responders: Vec<Box<dyn ResponderInterface + Send>>
)
[src]

This method creates a new HTTP over TCP application based on configuration

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

Auto Trait Implementations

impl Send for TCP

impl Sync for TCP

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]