canic/model/memory/topology/mod.rs
1mod app;
2mod subnet;
3
4pub use app::*;
5pub use subnet::*;
6
7use crate::types::SubnetType;
8use candid::{CandidType, Principal};
9use serde::Deserialize;
10
11///
12/// SubnetIdentity
13///
14
15#[derive(CandidType, Debug, Deserialize)]
16pub enum SubnetIdentity {
17 Prime,
18
19 // this subnet is general-purpose subnet that syncs from Prime
20 Standard(SubnetContextParams),
21
22 // explicitly provided subnet principal (test/support only)
23 Manual(Principal),
24}
25
26///
27/// SubnetContextParams
28/// everything we need to populate the SubnetContext on a non-Prime subnet
29///
30
31#[derive(CandidType, Debug, Deserialize)]
32pub struct SubnetContextParams {
33 pub subnet_type: SubnetType,
34 pub prime_root_pid: Principal,
35}