pub struct ServerConfig {
pub server: ServerInfo,
pub sites: Vec<SiteConfig>,
pub logging: LoggingConfig,
pub performance: PerformanceConfig,
pub security: SecurityConfig,
pub management: ManagementConfig,
}Expand description
Top-level server configuration for BWS. Contains global server info, site definitions, and all major subsystems.
Fields§
§server: ServerInfoGeneral server info (name, version, description)
sites: Vec<SiteConfig>List of all configured sites (virtual hosts)
logging: LoggingConfigLogging configuration
performance: PerformanceConfigPerformance tuning configuration
security: SecurityConfigSecurity-related configuration
management: ManagementConfigManagement API configuration
Implementations§
Source§impl ServerConfig
impl ServerConfig
pub fn load_from_file(path: &str) -> Result<Self, Box<dyn Error>>
pub fn save_to_file(&self, path: &str) -> Result<(), Box<dyn Error>>
pub fn validate(&self) -> Result<(), Box<dyn Error>>
pub fn find_site_by_host_port( &self, host: &str, port: u16, ) -> Option<&SiteConfig>
pub fn get_ssl_domains(&self) -> Vec<String>
pub fn get_site_by_domain(&self, domain: &str) -> Option<&SiteConfig>
pub fn reload_from_file(&mut self, path: &str) -> Result<(), Box<dyn Error>>
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServerConfig
impl Debug for ServerConfig
Source§impl<'de> Deserialize<'de> for ServerConfig
impl<'de> Deserialize<'de> for ServerConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnwindSafe for ServerConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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