canic_core/dto/placement/
sharding.rs1use crate::dto::prelude::*;
2
3#[derive(CandidType, Clone, Debug, Deserialize)]
8pub struct ShardingRegistryEntry {
9 pub pid: Principal,
10 pub entry: ShardEntry,
11}
12
13#[derive(CandidType, Clone, Debug, Deserialize)]
18pub struct ShardingRegistryResponse(pub Vec<ShardingRegistryEntry>);
19
20#[derive(CandidType, Clone, Debug, Deserialize)]
25pub struct ShardingPartitionKeysResponse(pub Vec<String>);
26
27#[derive(CandidType, Clone, Debug, Deserialize, Eq, PartialEq)]
32pub struct ShardEntry {
33 pub slot: u32,
35 pub capacity: u32,
36 pub count: u32,
37 pub pool: String,
38 pub canister_role: CanisterRole,
39 pub created_at: u64,
40}
41
42#[derive(CandidType, Clone, Debug, Deserialize, Eq, PartialEq)]
47pub enum ShardingPlanStateResponse {
48 AlreadyAssigned { pid: Principal },
50
51 UseExisting { pid: Principal },
53
54 CreateAllowed,
56
57 CreateBlocked { reason: String },
59}