pub struct AppConfig { /* private fields */ }Expand description
Validated application settings loaded once during process startup.
Implementations§
Source§impl AppConfig
impl AppConfig
Sourcepub fn load() -> Result<Self, ConfigError>
pub fn load() -> Result<Self, ConfigError>
Load the conventional optional .env and process environment.
§Errors
Returns an error for malformed files, invalid values, or missing production requirements.
pub fn builder() -> AppConfigBuilder
Source§impl AppConfig
impl AppConfig
pub const fn environment(&self) -> Environment
pub fn address(&self) -> &str
pub fn public_url(&self) -> &str
pub fn database_url(&self) -> &str
pub fn vite_dev_url(&self) -> Option<&str>
pub fn trusted_proxies(&self) -> &[IpAddr]
pub fn allowed_hosts(&self) -> &[String]
pub const fn rate_limit_requests(&self) -> u64
pub const fn rate_limit_window(&self) -> Duration
pub fn secret(&self, key: &str) -> Option<&SecretValue>
Trait Implementations§
Auto Trait Implementations§
impl Forget for AppConfig
impl Freeze for AppConfigwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<[IpAddr]> is !null: Freeze,
PhantomData<ArcInner<[IpAddr]>>: Freeze,
*const ArcInner<[String]> is !null: Freeze,
PhantomData<ArcInner<[String]>>: Freeze,
*const ArcInner<BTreeMap<String, SecretValue>> is !null: Freeze,
PhantomData<ArcInner<BTreeMap<String, SecretValue>>>: Freeze,
impl Move for AppConfig
impl RefUnwindSafe for AppConfig
impl Send for AppConfig
impl Sync for AppConfig
impl Unpin for AppConfig
impl UnsafeUnpin for AppConfigwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<[IpAddr]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[IpAddr]>>: UnsafeUnpin,
*const ArcInner<[String]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[String]>>: UnsafeUnpin,
*const ArcInner<BTreeMap<String, SecretValue>> is !null: UnsafeUnpin,
PhantomData<ArcInner<BTreeMap<String, SecretValue>>>: UnsafeUnpin,
impl UnwindSafe for AppConfigwhere
RawVecInner: UnwindSafe,
Arc<[IpAddr]>: UnwindSafe,
Arc<[String]>: UnwindSafe,
Arc<BTreeMap<String, SecretValue>>: UnwindSafe,
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