On continue l'implementation de pmoupnp

This commit is contained in:
2025-10-01 15:44:52 +02:00
parent a23d9bf845
commit 92ef3271d6
15 changed files with 618 additions and 31 deletions

View File

@@ -2,18 +2,8 @@ use xmltree::{Element, EmitterConfig};
use crate::UpnpObjectType;
pub trait UpnpObject {
fn as_upnp_object_type(&self) -> &UpnpObjectType;
pub trait UpnpXml {
fn to_xml_element(&self) -> Element;
fn get_name(&self) -> &String {
return &self.as_upnp_object_type().name;
}
fn get_object_type(&self) -> &String {
&self.as_upnp_object_type().object_type
}
fn to_xml(&self) -> String {
let elem = self.to_xml_element();
@@ -35,3 +25,16 @@ pub trait UpnpObject {
xml_string
}
}
pub trait UpnpObject : UpnpXml {
fn as_upnp_object_type(&self) -> &UpnpObjectType;
fn get_name(&self) -> &String {
return &self.as_upnp_object_type().name;
}
fn get_object_type(&self) -> &String {
&self.as_upnp_object_type().object_type
}
}