canic_core/dto/subnet.rs
1use crate::dto::prelude::*;
2
3//
4// SubnetIdentity
5//
6// Represents the *runtime identity* of the subnet this canister is executing in.
7// Must never be constructed from configuration alone.
8//
9
10#[derive(CandidType, Debug, Deserialize)]
11pub enum SubnetIdentity {
12 Prime,
13
14 PrimeWithModuleHash(Vec<u8>),
15
16 // this subnet is general-purpose subnet that syncs from Prime
17 Standard(SubnetContextParams),
18
19 // do not attempt subnet discovery (test / support mode)
20 Manual,
21}
22
23//
24// SubnetContextParams
25// everything we need to populate the SubnetContext on a non-Prime subnet
26//
27
28#[derive(CandidType, Debug, Deserialize)]
29pub struct SubnetContextParams {
30 pub subnet_type: SubnetRole,
31 pub prime_root_pid: Principal,
32}