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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
use crate::header::ZomeId;
use crate::zome::ZomeName;
use crate::AppEntryType;
use crate::EntryDefId;
use crate::EntryDefs;
use crate::FunctionName;
use holo_hash::DnaHash;
use holochain_serialized_bytes::prelude::*;
#[allow(missing_docs)]
#[derive(Clone, Debug, Serialize, Deserialize, SerializedBytes, PartialEq)]
pub struct ZomeInfo {
pub name: ZomeName,
pub id: ZomeId,
pub properties: SerializedBytes,
pub entry_defs: EntryDefs,
pub extern_fns: Vec<FunctionName>,
}
impl ZomeInfo {
pub fn new(
name: ZomeName,
id: ZomeId,
properties: SerializedBytes,
entry_defs: EntryDefs,
extern_fns: Vec<FunctionName>,
) -> Self {
Self {
name,
id,
properties,
entry_defs,
extern_fns,
}
}
pub fn matches_entry_def_id(&self, entry_type: &AppEntryType, id: EntryDefId) -> bool {
self.entry_defs
.0
.get(entry_type.id.index())
.map_or(false, |stored_id| stored_id.id == id)
&& self.id == entry_type.zome_id
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct DnaInfo {
pub name: String,
pub hash: DnaHash,
pub properties: SerializedBytes,
pub zome_names: Vec<ZomeName>,
}