zbus/message/
field_code.rs

1use serde_repr::{Deserialize_repr, Serialize_repr};
2
3use zvariant::Type;
4
5/// The message field code.
6///
7/// Every [`Field`] has an associated code. This is mostly an internal D-Bus protocol detail
8/// that you would not need to ever care about when using the high-level API. When using the
9/// low-level API, this is how you can [retrieve a specific field] from [`Fields`].
10///
11/// [`Field`]: enum.Field.html
12/// [retrieve a specific field]: struct.Fields.html#method.get_field
13/// [`Fields`]: struct.Fields.html
14#[repr(u8)]
15#[derive(Copy, Clone, Debug, Deserialize_repr, PartialEq, Eq, Serialize_repr, Type)]
16pub(crate) enum FieldCode {
17    /// Code for [`Field::Path`](enum.Field.html#variant.Path).
18    Path = 1,
19    /// Code for [`Field::Interface`](enum.Field.html#variant.Interface).
20    Interface = 2,
21    /// Code for [`Field::Member`](enum.Field.html#variant.Member).
22    Member = 3,
23    /// Code for [`Field::ErrorName`](enum.Field.html#variant.ErrorName).
24    ErrorName = 4,
25    /// Code for [`Field::ReplySerial`](enum.Field.html#variant.ReplySerial).
26    ReplySerial = 5,
27    /// Code for [`Field::Destination`](enum.Field.html#variant.Destination).
28    Destination = 6,
29    /// Code for [`Field::Sender`](enum.Field.html#variant.Sender).
30    Sender = 7,
31    /// Code for [`Field::Signature`](enum.Field.html#variant.Signature).
32    Signature = 8,
33    /// Code for [`Field::UnixFDs`](enum.Field.html#variant.UnixFDs).
34    UnixFDs = 9,
35}