pub struct ConfigBuilder { /* private fields */ }Expand description
Configuration builder for easy setup
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
pub fn new() -> Self
pub fn with_database_url(self, url: impl Into<String>) -> Self
pub fn with_database_max_connections(self, max_connections: u32) -> Self
pub fn with_database_min_connections(self, min_connections: u32) -> Self
pub fn with_database_connect_timeout(self, seconds: u64) -> Self
pub fn with_jwt_secret(self, secret: impl Into<String>) -> Self
pub fn with_jwt_issuer(self, issuer: impl Into<String>) -> Self
pub fn with_jwt_audience(self, audience: impl Into<String>) -> Self
pub fn with_access_token_ttl_seconds(self, ttl_seconds: u64) -> Self
pub fn with_refresh_token_ttl_seconds(self, ttl_seconds: u64) -> Self
pub fn with_redis_url(self, url: impl Into<String>) -> Self
pub fn with_redis_pool_size(self, pool_size: u32) -> Self
Sourcepub fn with_password_policy(
self,
min_length: usize,
require_special: bool,
) -> Self
pub fn with_password_policy( self, min_length: usize, require_special: bool, ) -> Self
Set password policy constraints.
§Arguments
min_length- minimum password length (typically 8+)require_special- require at least one special character (!@#$%^&* etc.)
pub fn with_rate_limit_requests_per_minute(self, requests: u32) -> Self
pub fn with_session_timeout_hours(self, hours: u64) -> Self
pub fn with_require_mfa(self, require_mfa: bool) -> Self
pub fn with_log_level(self, level: impl Into<String>) -> Self
pub fn build(self) -> AppConfig
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnsafeUnpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
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
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