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

30 lines
740 B
Rust

use crate::capnp::user::User;
use crate::resources::modules::fabaccess::{ArchivedStatus, Status};
use crate::resources::Resource;
use crate::session::SessionHandle;
use api::resource_capnp::resource;
use api::claim_capnp::claimable;
use capnp::capability::Promise;
use capnp_rpc::pry;
#[derive(Clone)]
pub struct Machine {
session: SessionHandle,
resource: Resource,
}
impl Machine {
pub fn new(session: SessionHandle, resource: Resource) -> Self {
Self { session, resource }
}
pub fn fill_resource(self, builder: &mut resource::Builder) {
builder.set_identifier(self.resource.get_id());
builder.set_claim(capnp_rpc::new_client(self.clone()));
}
}
impl claimable::Server for Machine {
}