canic_core/dto/
placement.rs1use crate::dto::prelude::*;
2
3#[derive(CandidType, Clone, Debug, Deserialize, Serialize)]
8pub struct ScalingRegistryEntryView {
9 pub pid: Principal,
10 pub entry: WorkerEntryView,
11}
12
13#[derive(CandidType, Clone, Debug, Deserialize, Serialize)]
18pub struct ScalingRegistryView(pub Vec<ScalingRegistryEntryView>);
19
20#[derive(CandidType, Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
25pub struct WorkerEntryView {
26 pub pool: String, pub canister_role: CanisterRole, pub created_at_secs: u64, }
30
31#[derive(CandidType, Clone, Debug, Deserialize, Serialize)]
36pub struct ShardingRegistryEntryView {
37 pub pid: Principal,
38 pub entry: ShardEntryView,
39}
40
41#[derive(CandidType, Clone, Debug, Deserialize, Serialize)]
46pub struct ShardingRegistryView(pub Vec<ShardingRegistryEntryView>);
47
48#[derive(CandidType, Clone, Debug, Deserialize, Serialize)]
53pub struct ShardingTenantsView(pub Vec<String>);
54
55#[derive(CandidType, Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
60pub struct ShardEntryView {
61 pub slot: u32,
63 pub capacity: u32,
64 pub count: u32,
65 pub pool: String,
66 pub canister_role: CanisterRole,
67 pub created_at: u64,
68}
69
70#[derive(CandidType, Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
75pub enum ShardingPlanStateView {
76 AlreadyAssigned { pid: Principal },
78
79 UseExisting { pid: Principal },
81
82 CreateAllowed,
84
85 CreateBlocked { reason: String },
87}