mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
add formal wrapping for api state
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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 }
|
||||
}
|
||||
Reference in New Issue
Block a user