conduwuit/src/api/router/state.rs
Jason Volk ccef1a4c8b add formal wrapping for api state
Signed-off-by: Jason Volk <jason@zemos.net>
2024-07-28 21:32:43 +00:00

22 lines
333 B
Rust

use std::{ops::Deref, sync::Arc};
use conduit_service::Services;
#[derive(Clone)]
pub struct State {
services: Arc<Services>,
}
impl State {
pub fn new(services: Arc<Services>) -> Self {
Self {
services,
}
}
}
impl Deref for State {
type Target = Arc<Services>;
fn deref(&self) -> &Self::Target { &self.services }
}