2022-04-21 23:02:58 +02:00
|
|
|
use crate::authorization::permissions::Permission;
|
2024-04-22 15:30:34 +02:00
|
|
|
use api::main_capnp::session::Owned as CPSession;
|
|
|
|
use api::auth_capnp::response::successful::Builder;
|
2024-05-14 11:05:39 +02:00
|
|
|
use crate::capnp::resources::Machines;
|
2022-03-15 20:00:43 +01:00
|
|
|
|
2022-05-05 15:50:44 +02:00
|
|
|
use crate::session::SessionHandle;
|
2021-12-06 21:53:42 +01:00
|
|
|
|
|
|
|
#[derive(Debug, Clone)]
|
2022-03-12 17:31:53 +01:00
|
|
|
pub struct APISession;
|
2021-12-06 21:53:42 +01:00
|
|
|
|
2022-03-12 17:31:53 +01:00
|
|
|
impl APISession {
|
2021-12-06 21:53:42 +01:00
|
|
|
pub fn new() -> Self {
|
2022-03-12 17:31:53 +01:00
|
|
|
Self
|
|
|
|
}
|
|
|
|
|
2024-04-22 15:30:34 +02:00
|
|
|
pub fn build(session: SessionHandle, builder: Builder<CPSession>) {
|
2022-03-12 17:31:53 +01:00
|
|
|
let mut builder = builder.init_session();
|
2022-04-21 23:02:58 +02:00
|
|
|
|
2024-05-14 11:05:39 +02:00
|
|
|
builder.set_resources(capnp_rpc::new_client(Machines::new(session)))
|
2021-12-06 21:53:42 +01:00
|
|
|
}
|
2022-05-05 15:50:44 +02:00
|
|
|
}
|