From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id BF4951FF0B2 for ; Mon, 24 Aug 2026 14:33:42 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id A282121563; Mon, 24 Aug 2026 14:33:41 +0200 (CEST) Message-ID: <31c21925-e3c4-48b0-b41b-98ef2f991007@proxmox.com> Date: Mon, 24 Aug 2026 14:33:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH proxmox v2 03/20] api-macro: support shared state extraction type To: Lukas Wagner , pdm-devel@lists.proxmox.com References: <20260820145220.418032-1-l.wagner@proxmox.com> <20260820145220.418032-4-l.wagner@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: <20260820145220.418032-4-l.wagner@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787574787814 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.758 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: C45AXP4MUZEXZ6UX2WNBPGYIWJT2RYBP X-Message-ID-Hash: C45AXP4MUZEXZ6UX2WNBPGYIWJT2RYBP X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: one comment inline On 8/20/26 4:52 PM, Lukas Wagner wrote: [snip] > > +fn as_state_type(ty: &syn::Type) -> Option { > + if let syn::Type::Path(p) = ty { > + if p.qself.is_some() { > + return None; > + } > + > + if let Some(ps) = p.path.segments.last() { > + if ps.ident != "State" { > + return None; > + } > + > + match &ps.arguments { > + syn::PathArguments::AngleBracketed(angle_bracketed_generic_arguments) => { > + if angle_bracketed_generic_arguments.args.len() != 1 { > + return None; > + } > + > + let generic_argument = angle_bracketed_generic_arguments.args[0].clone(); > + > + match generic_argument { > + syn::GenericArgument::Type(ty) => return Some(StateParameter { ty }), > + _ => return None, > + } > + } > + _ => return None, > + } > + } > + } > + > + None > +} just a nit, but IIUC this method parses all parameters out that have a State type? e.g i couldn't use a myfoo::bar::State parameter anymore? not that i think this is super critical, but maybe some kind of namespace in the type would be nice? e.g. PmxAppState ? this is a bit longer, but much less chance to collide with other things...