pub struct AppConfig {
pub listen_addr: String,
pub listen_port: u16,
pub data_dir: PathBuf,
pub tls_cert: Option<PathBuf>,
pub tls_key: Option<PathBuf>,
}Expand description
Bootstrap application configuration (from TOML file).
Runtime-changeable settings (theme, CSAF mode, etc.) are stored in redb
via the Settings model. This config only contains startup parameters.
Fields§
§listen_addr: StringListen address (default: "127.0.0.1").
listen_port: u16Listen port (default: 8443).
data_dir: PathBufData directory for databases.
tls_cert: Option<PathBuf>TLS certificate file path (PEM). Auto-generated if absent.
tls_key: Option<PathBuf>TLS private key file path (PEM). Auto-generated if absent.
Implementations§
Source§impl AppConfig
impl AppConfig
Sourcepub fn load(path: &Path) -> Result<Self>
pub fn load(path: &Path) -> Result<Self>
Load configuration from a TOML file, falling back to defaults.
§Errors
Returns an error if the file exists but cannot be read or parsed.
Sourcepub fn sqlite_path(&self) -> PathBuf
pub fn sqlite_path(&self) -> PathBuf
Path to the SQLite database file.
Sourcepub fn listen_address(&self) -> String
pub fn listen_address(&self) -> String
Full listen address string (e.g. "127.0.0.1:8443").
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AppConfig
impl<'de> Deserialize<'de> for AppConfig
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 AppConfig
impl RefUnwindSafe for AppConfig
impl Send for AppConfig
impl Sync for AppConfig
impl Unpin for AppConfig
impl UnsafeUnpin for AppConfig
impl UnwindSafe for AppConfig
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