zvariant_utils/serialized.rs
1/// The encoding format.
2#[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
3pub enum Format {
4 /// [D-Bus](https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-marshaling)
5 /// format.
6 #[default]
7 DBus,
8 /// [GVariant](https://developer.gnome.org/glib/stable/glib-GVariant.html) format.
9 #[cfg(feature = "gvariant")]
10 GVariant,
11}
12
13impl std::fmt::Display for Format {
14 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15 match self {
16 Format::DBus => write!(f, "D-Bus"),
17 #[cfg(feature = "gvariant")]
18 Format::GVariant => write!(f, "GVariant"),
19 }
20 }
21}