fabaccess-bffh/bffhd/capnp/session.rs
Nadja von Reitzenstein Čerpnjak 5400d7f799 Implement resource API
2024-05-14 11:05:39 +02:00

22 lines
550 B
Rust

use crate::authorization::permissions::Permission;
use api::main_capnp::session::Owned as CPSession;
use api::auth_capnp::response::successful::Builder;
use crate::capnp::resources::Machines;
use crate::session::SessionHandle;
#[derive(Debug, Clone)]
pub struct APISession;
impl APISession {
pub fn new() -> Self {
Self
}
pub fn build(session: SessionHandle, builder: Builder<CPSession>) {
let mut builder = builder.init_session();
builder.set_resources(capnp_rpc::new_client(Machines::new(session)))
}
}