[][src]Struct milstian_internet_framework::Config

pub struct Config {
    pub feedback_error_file: Option<String>,
    pub feedback_info_file: Option<String>,
    pub file_not_found_file: String,
    pub filesystem_directory_index: String,
    pub filesystem_root: String,
    pub server_limit: usize,
    pub server_host: String,
    pub server_port: u32,
    pub tcp_limit: usize,
}

Holds application configuration, can be created in different ways.

From environment:

use milstian_internet_framework::Config;
let config = Config::from_env();
assert!(config.is_err()); // Expected fail since environment variables is missing

Fields

feedback_error_file: Option<String>feedback_info_file: Option<String>file_not_found_file: Stringfilesystem_directory_index: Stringfilesystem_root: Stringserver_limit: usizeserver_host: Stringserver_port: u32tcp_limit: usize

Methods

impl Config[src]

pub fn get_canonical_root(root_path: &String) -> Result<String, String>[src]

Find canonical root from a string path

pub fn from_env_args(args: Vec<String>) -> Result<Config, String>[src]

This method takes a vector of strings and creates a config struct based on argument vector

pub fn from_env() -> Result<Config, String>[src]

This method collects arguments from environment and passes them on to method from_env_args

Example

use milstian_internet_framework::Config;
let config = Config::from_env();
assert!(config.is_err()); // Expected fail since environment variables is missing

Trait Implementations

impl Clone for Config[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Config[src]

Auto Trait Implementations

impl Send for Config

impl Sync for Config

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for 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]