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,
}
Expand description
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
Implementations§
Source§impl Config
impl Config
Sourcepub fn get_canonical_root(root_path: &String) -> Result<String, String>
pub fn get_canonical_root(root_path: &String) -> Result<String, String>
Find canonical root from a string path
Sourcepub fn from_env_args(args: Vec<String>) -> Result<Config, String>
pub fn from_env_args(args: Vec<String>) -> Result<Config, String>
This method takes a vector of strings and creates a config struct based on argument vector
Sourcepub fn from_env() -> Result<Config, String>
pub fn from_env() -> Result<Config, String>
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
Examples found in repository?
More examples
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more