Skip to main content

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    // this subnet is general-purpose subnet that syncs from Prime
15    Standard(SubnetContextParams),
16
17    // do not attempt subnet discovery (test / support mode)
18    Manual,
19}
20
21//
22// SubnetContextParams
23// everything we need to populate the SubnetContext on a non-Prime subnet
24//
25
26#[derive(CandidType, Debug, Deserialize)]
27pub struct SubnetContextParams {
28    pub subnet_type: SubnetRole,
29    pub prime_root_pid: Principal,
30}