Enum Fd Copy item path Source pub enum Fd<'f> {
Borrowed(BorrowedFd <'f>),
Owned(OwnedFd ),
}Expand description A file-descriptor type wrapper.
Since std::os::fd::BorrowedFd and std::os::fd::OwnedFd types
do not implement Serialize and Deserialize . So we provide a
wrapper for both that implements these traits.
§ D-Bus FD Encoding
In D-Bus, file descriptors are not encoded as their raw numeric values on the wire.
Instead, the message body contains a u32 index into an out-of-band array of file
descriptors that is transferred alongside the message via SCM_RIGHTS on Unix sockets.
The Deserialize implementation on this type is designed for zvariant’s D-Bus
deserializer, which resolves that index through the message’s FD list before calling the
serde visitor. Using this type with other deserializers (JSON, CBOR, etc.) is not
supported — you would receive a BorrowedFd pointing to whatever FD number happened to
be in the payload, which is almost certainly not what you want.
Try to create an owned version of self.
The type signature, as a character.
The type signature, as a string.
The required padding alignment for the given format.
Read more Formats the value using the given formatter.
Read more Deserialize this value from the given Serde deserializer.
Read more Formats the value using the given formatter.
Read more Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Compares and returns the maximum of two values.
Read more Compares and returns the minimum of two values.
Read more Restrict a value to a certain interval.
Read more Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
This method returns an ordering between
self and
other values if one exists.
Read more Tests less than (for
self and
other) and is used by the
< operator.
Read more Tests less than or equal to (for
self and
other) and is used by the
<= operator.
Read more Tests greater than (for
self and
other) and is used by the
>
operator.
Read more Tests greater than or equal to (for
self and
other) and is used by
the
>= operator.
Read more Serialize this value into the given Serde serializer.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The signature for the implementing type, in parsed format.
Read more Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more Get a deserializer compatible with this parsed signature.
Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
Converts the given value to a
String.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.