-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathlib.rs
30 lines (27 loc) · 819 Bytes
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
* hREA agent integrity zome for API definition
*
* Defines the top-level zome configuration needed by Holochain's build system
* to bundle the app. This basically involves wiring up the helper methods from the
* related `_lib` module into a packaged zome WASM binary.
*
* @package hREA
*/
use hdi::prelude::*;
pub use hc_zome_rea_agent_storage::{EntryDefinitions, EntryTypesUnit, LinkTypes};
#[hdk_extern]
pub fn entry_defs(_: ()) -> ExternResult<EntryDefsCallbackResult> {
let defs: Vec<EntryDef> = EntryDefinitions::ENTRY_DEFS
.iter()
.map(|a| EntryDef::from(a.clone()))
.collect();
Ok(EntryDefsCallbackResult::from(defs))
}
#[no_mangle]
pub fn __num_entry_types() -> u8 {
EntryTypesUnit::len()
}
#[no_mangle]
pub fn __num_link_types() -> u8 {
LinkTypes::len()
}