canic_core/ids/
network.rs1use crate::cdk::candid::CandidType;
8use serde::{Deserialize, Serialize};
9use std::fmt::{self, Display};
10
11#[derive(CandidType, Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
19pub enum BuildNetwork {
20 Ic,
21 Local,
22}
23
24impl BuildNetwork {
25 #[must_use]
27 pub const fn as_str(self) -> &'static str {
28 match self {
29 Self::Ic => "ic",
30 Self::Local => "local",
31 }
32 }
33}
34
35impl Display for BuildNetwork {
36 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
37 f.write_str(self.as_str())
38 }
39}