1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use super::{CandidType, Serializer, Type, TypeInner};

pub use ic_principal::{Principal, PrincipalError};

impl CandidType for Principal {
    fn _ty() -> Type {
        TypeInner::Principal.into()
    }
    fn idl_serialize<S>(&self, serializer: S) -> Result<(), S::Error>
    where
        S: Serializer,
    {
        serializer.serialize_principal(self.as_slice())
    }
}