use crate::config::Settings;
#[derive(Clone, Debug)]
pub struct Context {
pub(crate) config: Settings,
}
impl Context {
pub fn new(config: Settings) -> Self {
Self { config }
}
getter! {
config: Settings
}
setwith! {
config: Settings
}
}
impl Default for Context {
fn default() -> Self {
Self {
config: Settings::default(),
}
}
}
impl axum::extract::FromRef<Context> for Settings {
fn from_ref(ctx: &Context) -> Self {
ctx.config.clone()
}
}