Resources lookup impl

This commit is contained in:
Nadja Reitzenstein
2022-03-13 20:33:26 +01:00
parent d5833f30c4
commit 07a7cbe42b
4 changed files with 49 additions and 16 deletions

View File

@ -6,6 +6,7 @@ use api::machinesystem_capnp::machine_system::{
use capnp::capability::Promise;
use capnp_rpc::pry;
use crate::capnp::machine::Machine;
use crate::RESOURCES;
use crate::resources::Resource;
use crate::resources::search::ResourcesHandle;
@ -17,8 +18,8 @@ pub struct Machines {
impl Machines {
pub fn new(session: SessionHandle) -> Self {
let resources = ResourcesHandle::new();
Self { session, resources }
// FIXME no unwrap bad
Self { session, resources: RESOURCES.get().unwrap().clone() }
}
}