pub struct RouterConfig {
pub dashboard_dir: Option<PathBuf>,
pub rate_limit_auth: Option<u32>,
pub rate_limit_general: Option<u32>,
}Expand description
Router-level configuration with sensible defaults.
Controls dashboard serving, rate limiting, and other router behaviors.
Use Default::default() for production-ready defaults, then override
individual fields as needed.
§Examples
use ironflow_api::routes::RouterConfig;
// All defaults: rate limiting enabled, no custom dashboard dir
let config = RouterConfig::default();
assert_eq!(config.rate_limit_auth, Some(10));
// Disable auth rate limiting, custom dashboard
let config = RouterConfig {
rate_limit_auth: None,
..RouterConfig::default()
};Fields§
§dashboard_dir: Option<PathBuf>Filesystem path to dashboard assets. When set, serves the SPA from this directory instead of the embedded build.
rate_limit_auth: Option<u32>Rate limit for auth credential routes (sign-in, sign-up) in
requests per minute per IP. None disables the limiter.
rate_limit_general: Option<u32>Rate limit for general public API routes in requests per minute
per IP. None disables the limiter.
Trait Implementations§
Source§impl Clone for RouterConfig
impl Clone for RouterConfig
Source§fn clone(&self) -> RouterConfig
fn clone(&self) -> RouterConfig
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 RouterConfig
impl Debug for RouterConfig
Auto Trait Implementations§
impl Freeze for RouterConfig
impl RefUnwindSafe for RouterConfig
impl Send for RouterConfig
impl Sync for RouterConfig
impl Unpin for RouterConfig
impl UnsafeUnpin for RouterConfig
impl UnwindSafe for RouterConfig
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