pubsub: Add a constructor for items request.

This commit is contained in:
Emmanuel Gil Peyrot 2019-10-12 17:14:00 +02:00
parent 7665f7e5d8
commit 5338cd6599

View file

@ -113,6 +113,18 @@ generate_element!(
] ]
); );
impl Items {
/// Create a new items request.
pub fn new(node: &str) -> Items {
Items {
node: NodeName(String::from(node)),
max_items: None,
subid: None,
items: Vec::new(),
}
}
}
/// Response wrapper for a PubSub `<item/>`. /// Response wrapper for a PubSub `<item/>`.
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Item(pub PubSubItem); pub struct Item(pub PubSubItem);