From 54ea7b58130c784ec424d74530c64a16cac0ea4d Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Sat, 4 Apr 2026 00:22:58 +0200 Subject: [PATCH] :sparkles: add async_trait support for UpnpApiExt trait and impl - Add `async-trait` dependency import - Annotate UpnpApiExt trait and its Server impl with `#[async_trait]` to enable async methods in traits --- pmoupnp/src/upnp_api.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pmoupnp/src/upnp_api.rs b/pmoupnp/src/upnp_api.rs index 02449464..9d2e4316 100644 --- a/pmoupnp/src/upnp_api.rs +++ b/pmoupnp/src/upnp_api.rs @@ -17,6 +17,7 @@ use axum::{ response::{IntoResponse, Json}, routing::get, }; +use async_trait::async_trait; use pmoserver::Server; use serde_json::json; use tracing::info; @@ -218,6 +219,7 @@ async fn get_service_variables( /// Trait d'extension pour enregistrer l'API UPnP sur un serveur. /// /// Similaire à `WebAppExt` et `CoverCacheExt`. +#[async_trait] pub trait UpnpApiExt { /// Enregistre l'API REST d'introspection UPnP. /// @@ -229,6 +231,7 @@ pub trait UpnpApiExt { async fn register_upnp_api(&mut self); } +#[async_trait] impl UpnpApiExt for Server { async fn register_upnp_api(&mut self) { info!("📡 Registering UPnP introspection API...");