fabaccess-bffh/bffhd/capnp/resource.rs

30 lines
740 B
Rust
Raw Normal View History

2024-05-14 11:05:39 +02:00
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 {
}