[−][src]Struct milstian_internet_framework::Config
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: String
filesystem_directory_index: String
filesystem_root: String
server_limit: usize
server_host: String
server_port: u32
tcp_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(&self) -> 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
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,