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]
impl Application
pub fn tcp_http(
config: Result<Config, String>,
responders: Vec<Box<ResponderInterface + Send>>
)
[src]
pub fn tcp_http(
config: Result<Config, String>,
responders: Vec<Box<ResponderInterface + Send>>
)
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); }
pub fn tcp_http_with_legacy_responders(config: Result<Config, String>)
[src]
pub fn tcp_http_with_legacy_responders(config: Result<Config, String>)
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()); }
pub fn tcp_http_with_legacy_and_custom_responders(
config: Result<Config, String>,
custom: Box<ResponderInterface + Send>
)
[src]
pub fn tcp_http_with_legacy_and_custom_responders(
config: Result<Config, String>,
custom: Box<ResponderInterface + Send>
)
Create a new TCP/IP with legacy and a custom responder
Auto Trait Implementations
impl Send for Application
impl Send for Application
impl Sync for Application
impl Sync for Application