pub struct AppConfig {
pub app: AppSection,
pub server: ServerSection,
pub database: DatabaseSection,
pub queue: QueueSection,
pub inertia: InertiaSection,
}Expand description
Framework configuration: purwa.toml + env (PURWA_*).
Fields§
§app: AppSection§server: ServerSection§database: DatabaseSection§queue: QueueSection§inertia: InertiaSectionImplementations§
Source§impl AppConfig
impl AppConfig
Sourcepub fn load() -> Result<Arc<Self>, PurwaConfigError>
pub fn load() -> Result<Arc<Self>, PurwaConfigError>
Load using default discovery: optional ./purwa.toml (via config file name purwa) + env.
Sourcepub fn load_with_file(
purwa_toml: Option<&Path>,
) -> Result<Arc<Self>, PurwaConfigError>
pub fn load_with_file( purwa_toml: Option<&Path>, ) -> Result<Arc<Self>, PurwaConfigError>
Load from an explicit purwa.toml path, or when None use File::with_name("purwa") in the process CWD.
Sourcepub fn database_url(&self) -> Option<String>
pub fn database_url(&self) -> Option<String>
Resolved database connection URL for SQLx / PgPool.
Order: [database].url from config (file + PURWA_DATABASE__URL), then DATABASE_URL.
Sourcepub fn queue_redis_url(&self) -> Option<String>
pub fn queue_redis_url(&self) -> Option<String>
Resolved Redis connection URL for queue workers.
Order: [queue].redis_url from config (file + PURWA_QUEUE__REDIS_URL), then REDIS_URL.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more