dbus_addr/transport/
systemd.rs

1use std::marker::PhantomData;
2
3use super::{DBusAddr, KeyValFmt, Result, TransportImpl};
4
5/// `systemd:` D-Bus transport.
6///
7/// <https://dbus.freedesktop.org/doc/dbus-specification.html#transports-systemd>
8#[derive(Clone, Debug, PartialEq, Eq)]
9pub struct Systemd<'a> {
10    // use a phantom lifetime for eventually future fields and consistency
11    phantom: PhantomData<&'a ()>,
12}
13
14impl<'a> Systemd<'a> {
15    /// Convert into owned version, with 'static lifetime.
16    pub fn into_owned(&self) -> Systemd<'static> {
17        Systemd {
18            phantom: PhantomData,
19        }
20    }
21}
22
23impl<'a> TransportImpl<'a> for Systemd<'a> {
24    fn for_address(_addr: &'a DBusAddr<'a>) -> Result<Self> {
25        Ok(Systemd {
26            phantom: PhantomData,
27        })
28    }
29
30    fn fmt_key_val<'s: 'b, 'b>(&'s self, kv: KeyValFmt<'b>) -> KeyValFmt<'b> {
31        kv
32    }
33}