canic/memory/topology/
mod.rs1mod app;
2mod subnet;
3
4pub use app::*;
5pub use subnet::*;
6
7use crate::{Error, ThisError, memory::MemoryError, types::CanisterType};
8use candid::Principal;
9
10#[derive(Debug, ThisError)]
15pub enum TopologyError {
16 #[error("subnet not found: {0}")]
17 SubnetNotFound(Principal),
18
19 #[error("canister not found: {0}")]
20 PrincipalNotFound(Principal),
21
22 #[error("canister not found: {0}")]
23 TypeNotFound(CanisterType),
24
25 #[error(transparent)]
26 SubnetTopologyError(#[from] SubnetTopologyError),
27}
28
29impl From<TopologyError> for Error {
30 fn from(err: TopologyError) -> Self {
31 MemoryError::from(err).into()
32 }
33}