fn declare(&self, id: &str, ty: &IDLType) -> Result<String> {
        match ty {
            IDLType::PrimT(prim) => self.declare_prim(id, prim),
            IDLType::VarT(var) => self.declare_var(id, var),
            IDLType::FuncT(func) => self.declare_func(id, func),
            IDLType::OptT(sub_t) => self.declare_opt(id, sub_t.as_ref()),
            IDLType::VecT(item_t) => self.declare_vec(id, item_t.as_ref()),
            IDLType::RecordT(fields) => self.declare_record(id, fields),
            IDLType::VariantT(fields) => self.declare_variant(id, fields),
            IDLType::ServT(serv_t) => self.declare_service(id, serv_t),
            IDLType::ClassT(_, _) => unreachable!(),
            IDLType::PrincipalT => Ok("principal".to_string()),
        }
    }
/// String to use when declaring a type. This receives the ID of the type,
/// and the right hand side of the type itself. By default it forwards it to a
/// specialized method for each type.
String to use when declaring a type. This receives the ID of the type,
and the right hand side of the type itself. By default it forwards it to a
specialized method for each type.
String to use when declaring a type . This receives the ID of the type and the right hand side of the type itself . By default it forwards it to a specialized method for each type .
fn declare(&self, id: &str, ty: &IDLType) -> Result<String> {
        match ty {
            IDLType::PrimT(prim) => self.declare_prim(id, prim),
            IDLType::VarT(var) => self.declare_var(id, var),
            IDLType::FuncT(func) => self.declare_func(id, func),
            IDLType::OptT(sub_t) => self.declare_opt(id, sub_t.as_ref()),
            IDLType::VecT(item_t) => self.declare_vec(id, item_t.as_ref()),
            IDLType::RecordT(fields) => self.declare_record(id, fields),
            IDLType::VariantT(fields) => self.declare_variant(id, fields),
            IDLType::ServT(serv_t) => self.declare_service(id, serv_t),
            IDLType::ClassT(_, _) => unreachable!(),
            IDLType::PrincipalT => Ok("principal".to_string()),
        }
    }
fn declare ( & self , id : & str , ty : & IDLType ) -> Result < String > { match ty { IDLType :: PrimT ( prim ) => self . declare_prim ( id , prim ) , IDLType :: VarT ( var ) => self . declare_var ( id , var ) , IDLType :: FuncT ( func ) => self . declare_func ( id , func ) , IDLType :: OptT ( sub_t ) => self . declare_opt ( id , sub_t . as_ref ( ) ) , IDLType :: VecT ( item_t ) => self . declare_vec ( id , item_t . as_ref ( ) ) , IDLType :: RecordT ( fields ) => self . declare_record ( id , fields ) , IDLType :: VariantT ( fields ) => self . declare_variant ( id , fields ) , IDLType :: ServT ( serv_t ) => self . declare_service ( id , serv_t ) , IDLType :: ClassT ( _ , _ ) => unreachable ! ( ) , IDLType :: PrincipalT => Ok ( " " . to_string ( ) ) , } }
String to use when declaring a type.
String to use when declaring a type .
&self
id
&str
ty
&IDLType
&self
id
&str
ty
&IDLType