From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 63C9B1FF0C0 for ; Wed, 18 Nov 2026 10:44:46 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 67955216B6; Wed, 18 Nov 2026 10:44:03 +0100 (CET) From: Lukas Wagner To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox v2 09/63] notify: matcher: stub CalendarMatcher::matches on wasm32 Date: Wed, 18 Nov 2026 10:42:53 +0100 Message-ID: <20261118094348.273646-10-l.wagner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261118094348.273646-1-l.wagner@proxmox.com> References: <20261118094348.273646-1-l.wagner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794995035948 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.200 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: XV5QIYWGIHORFRSKOYSQKT72MVSE7KY6 X-Message-ID-Hash: XV5QIYWGIHORFRSKOYSQKT72MVSE7KY6 X-MailFrom: l.wagner@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 VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The matching logic is part of the api_types module, since it will be quite useful to test/validate matching in a Rust-based UI. Unfortunately, the DailyDuration type does not implement the `time_match` method on wasm32, which is why it is stubbed out for now. The current implementation of DailyDuration relies on libc, but there is no reason why we could not implement a wasm-friendly version of the same behavior, which is why stubbing out seemed like the most appropriate thing to do. Signed-off-by: Lukas Wagner --- Notes: New in v2. proxmox-notify/src/api_types/matcher/calendar.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/proxmox-notify/src/api_types/matcher/calendar.rs b/proxmox-notify/src/api_types/matcher/calendar.rs index 0a8d31e7a..a0640b49a 100644 --- a/proxmox-notify/src/api_types/matcher/calendar.rs +++ b/proxmox-notify/src/api_types/matcher/calendar.rs @@ -15,6 +15,7 @@ use super::MatchDirective; #[derive(Clone, Debug)] struct DailyDurationWrapper { schedule: String, + #[cfg_attr(target_arch = "wasm32", allow(unused))] daily_duration: DailyDuration, } @@ -61,6 +62,7 @@ impl From for Expression { } impl MatchDirective for CalendarMatcher { + #[cfg(not(target_arch = "wasm32"))] fn matches(&self, notification: &Notification) -> Result { self.schedule .daily_duration @@ -68,6 +70,13 @@ impl MatchDirective for CalendarMatcher { .map_err(|err| Error::invalid_config_with_source("could not match timestamp", err)) } + #[cfg(target_arch = "wasm32")] + fn matches(&self, _notification: &Notification) -> Result { + Err(Error::other( + "CalendarMatcher::matches not supported on wasm32", + )) + } + fn validate(&self) -> Result<(), Error> { Ok(()) } -- 2.47.3