Files
pmomusic/pmoupnp/src/actions/arg_instance_methods.rs

42 lines
912 B
Rust
Raw Normal View History

2025-10-02 18:39:32 +02:00
use xmltree::Element;
use crate::{actions::{Argument, ArgumentInstance}, UpnpInstance, UpnpObject, UpnpObjectType, UpnpTyped, UpnpTypedInstance};
impl UpnpObject for ArgumentInstance {
async fn to_xml_element(&self) -> Element {
self.get_model().to_xml_element().await
}
}
impl UpnpTyped for ArgumentInstance {
fn as_upnp_object_type(&self) -> &UpnpObjectType {
return &self.object;
}
}
impl UpnpTypedInstance for ArgumentInstance {
fn get_model(&self) -> &Self::Model {
&self.model
}
}
impl UpnpInstance for ArgumentInstance {
type Model = Argument;
fn new(from: &Argument) -> Self {
Self {
object: UpnpObjectType {
name: from.get_name().clone(),
object_type: "UpnpInstance".to_string(),
},
model: from.clone(),
variable_instance: None,
}
}
}