#[repr(transparent)]pub struct Descriptor(pub RawDescriptor);Expand description
For use cases where a simple wrapper around a RawDescriptor is needed, in order to e.g.
implement AsRawDescriptor.
This is a simply a wrapper and does not manage the lifetime of the descriptor. As such it is the
responsibility of the user to ensure that the wrapped descriptor will not be closed for as long
as the Descriptor is alive.
Most use-cases should prefer SafeDescriptor or implementing and using
AsRawDescriptor on the type providing the descriptor. Using this wrapper usually means
something can be improved in your code.
Valid uses of this struct include:
- You only have a valid
RawDescriptorand need to pass something that implementsAsRawDescriptorto a function, - You need to serialize a
RawDescriptor, - You need
SendorSyncfor your descriptor and properly handle the case where your descriptor gets closed.
Note that with the exception of the last use-case (which requires proper error checking against
the descriptor being closed), the Descriptor instance would be very short-lived.
Tuple Fields§
§0: RawDescriptorTrait Implementations§
Source§impl AsRawDescriptor for Descriptor
impl AsRawDescriptor for Descriptor
Source§fn as_raw_descriptor(&self) -> RawDescriptor
fn as_raw_descriptor(&self) -> RawDescriptor
Source§impl AsRawFd for Descriptor
impl AsRawFd for Descriptor
Source§impl Clone for Descriptor
impl Clone for Descriptor
Source§fn clone(&self) -> Descriptor
fn clone(&self) -> Descriptor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Descriptor
impl Debug for Descriptor
Source§impl<'de> Deserialize<'de> for Descriptor
impl<'de> Deserialize<'de> for Descriptor
Source§fn deserialize<D>(deserializer: D) -> Result<Descriptor, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Descriptor, D::Error>where
D: Deserializer<'de>,
Source§impl EventToken for Descriptor
Implement token for implementations that wish to use this struct as such
impl EventToken for Descriptor
Implement token for implementations that wish to use this struct as such
Source§fn as_raw_token(&self) -> u64
fn as_raw_token(&self) -> u64
from_raw_token.Source§fn from_raw_token(data: u64) -> Self
fn from_raw_token(data: u64) -> Self
as_raw_token back into a token. Read more