/// This method is called when a type is used as a right hand side. By default
/// it forwards it to a specialized method for each type.
This method is called when a type is used as a right hand side. By default
it forwards it to a specialized method for each type.
This method is called when a type is used as a right hand side . By default it forwards it to a specialized method for each type .
fn usage(&self, ty: &IDLType) -> Result<String> {
        match ty {
            IDLType::PrimT(prim) => self.usage_prim(prim),
            IDLType::VarT(var) => self.usage_var(var),
            IDLType::FuncT(func) => self.usage_func(func),
            IDLType::OptT(sub_t) => self.usage_opt(sub_t.as_ref()),
            IDLType::VecT(item_t) => self.usage_vec(item_t.as_ref()),
            IDLType::RecordT(fields) => self.usage_record(fields),
            IDLType::VariantT(fields) => self.usage_variant(fields),
            IDLType::ServT(serv_t) => self.usage_service(serv_t),
            IDLType::ClassT(_, _) => unreachable!(),
            IDLType::PrincipalT => Ok("principal".to_string()),
        }
    }
fn usage ( & self , ty : & IDLType ) -> Result < String > { match ty { IDLType :: PrimT ( prim ) => self . usage_prim ( prim ) , IDLType :: VarT ( var ) => self . usage_var ( var ) , IDLType :: FuncT ( func ) => self . usage_func ( func ) , IDLType :: OptT ( sub_t ) => self . usage_opt ( sub_t . as_ref ( ) ) , IDLType :: VecT ( item_t ) => self . usage_vec ( item_t . as_ref ( ) ) , IDLType :: RecordT ( fields ) => self . usage_record ( fields ) , IDLType :: VariantT ( fields ) => self . usage_variant ( fields ) , IDLType :: ServT ( serv_t ) => self . usage_service ( serv_t ) , IDLType :: ClassT ( _ , _ ) => unreachable ! ( ) , IDLType :: PrincipalT => Ok ( " " . to_string ( ) ) , } }
This method is called when a type is used as a right hand side.
This method is called when a type is used as a right hand side .
&self
ty
&IDLType