2021-12-06 21:53:42 +01:00
|
|
|
use api::session::Builder;
|
2022-03-10 20:52:34 +01:00
|
|
|
use crate::capnp::machinesystem::Resources;
|
2022-03-08 16:41:38 +01:00
|
|
|
use crate::capnp::users::Users;
|
2021-12-06 21:53:42 +01:00
|
|
|
|
|
|
|
#[derive(Debug, Clone)]
|
|
|
|
pub struct Session {
|
|
|
|
resources: Resources,
|
|
|
|
users: Users,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Session {
|
|
|
|
pub fn new() -> Self {
|
|
|
|
Session {
|
|
|
|
resources: Resources::new(),
|
|
|
|
users: Users::new(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn build(&self, builder: &mut Builder) {
|
|
|
|
builder.set_resources(capnp_rpc::new_client(self.resources.clone()));
|
|
|
|
builder.set_users(capnp_rpc::new_client(self.users.clone()));
|
|
|
|
}
|
|
|
|
}
|