On continue l'implementation de pmoupnp
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user