tokio_dbus_xml/
elements.rs

1use tokio_dbus_core::signature::Signature;
2
3/// A D-Bus node.
4#[derive(Debug, Clone)]
5pub struct Node<'a> {
6    /// Interfaces in the node.
7    pub interfaces: Box<[Interface<'a>]>,
8    /// Sub-nodes in the node.
9    pub nodes: Box<[Node<'a>]>,
10}
11
12/// A single interface.
13#[derive(Debug, Clone)]
14pub struct Interface<'a> {
15    /// The name of the interface.
16    pub name: &'a str,
17    /// Methods associated with the interface.
18    pub methods: Box<[Method<'a>]>,
19}
20
21/// The direction of an argument.
22#[derive(Debug, Clone, Copy)]
23pub enum Direction {
24    /// Input argument.
25    In,
26    /// Output argument.
27    Out,
28}
29
30/// A method argument.
31#[derive(Debug, Clone, Copy)]
32pub struct Argument<'a> {
33    /// The name of the argument.
34    pub name: Option<&'a str>,
35    /// The type of the argument.
36    pub ty: &'a Signature,
37    /// The direction of an argument.
38    pub direction: Direction,
39}
40
41/// A single interface.
42#[derive(Debug, Clone)]
43pub struct Method<'a> {
44    /// The name of the interface.
45    pub name: &'a str,
46    /// Arguments to the method.
47    pub arguments: Box<[Argument<'a>]>,
48}
49
50/// Documentation associated with an element.
51#[derive(Debug, Default)]
52pub struct Doc<'a> {
53    /// Documentation summary.
54    pub summary: Option<&'a str>,
55    /// Description.
56    pub description: Description<'a>,
57}
58
59/// The description of an element.
60#[derive(Debug, Default)]
61pub struct Description<'a> {
62    /// Paragraph describing an element.
63    pub paragraph: Option<&'a str>,
64}