Lines Matching full:descriptor
21 /// Trait for forfeiting ownership of the current raw descriptor, and returning the raw descriptor
26 /// Trait for returning the underlying raw descriptor, without giving up ownership of the
27 /// descriptor.
34 /// Safe only if the caller ensures nothing has access to the descriptor after passing it to
36 unsafe fn from_raw_descriptor(descriptor: RawDescriptor) -> Self; in from_raw_descriptor()
39 /// Clones `fd`, returning a new file descriptor that refers to the same open file description as
41 /// descriptor flags with `fd`.
57 descriptor: RawDescriptor, field
65 if self.descriptor == other.descriptor { in eq()
78 self.descriptor, in eq()
79 other.descriptor, in eq()
89 let _ = unsafe { libc::close(self.descriptor) }; in drop()
95 self.descriptor in as_raw_descriptor()
101 let descriptor = self.descriptor; in into_raw_descriptor() localVariable
103 descriptor in into_raw_descriptor()
108 unsafe fn from_raw_descriptor(descriptor: RawDescriptor) -> Self { in from_raw_descriptor()
109 SafeDescriptor { descriptor } in from_raw_descriptor()
124 descriptor: clone_fd(fd)?, in try_from()
130 /// Clones this descriptor, internally creating a new descriptor. The new SafeDescriptor will
134 let descriptor = unsafe { libc::fcntl(self.descriptor, libc::F_DUPFD_CLOEXEC, 0) }; in try_clone() localVariable
135 if descriptor < 0 { in try_clone()
138 Ok(SafeDescriptor { descriptor }) in try_clone()
158 /// This is a simply a wrapper and does not manage the lifetime of the descriptor.
162 pub struct Descriptor(pub RawDescriptor); struct
163 impl AsRawDescriptor for Descriptor { implementation
171 impl AsRawFd for Descriptor { implementation
178 impl PollToken for Descriptor { implementation
184 Descriptor(data as RawDescriptor) in from_raw_token()
201 unsafe fn from_raw_descriptor(descriptor: RawDescriptor) -> Self {
202 $name::from_raw_fd(descriptor)
220 // descriptor container. That should go to either SafeDescriptor or another more
249 unsafe fn from_raw_descriptor(descriptor: RawDescriptor) -> Self { in from_raw_descriptor()
250 Self::from_raw_fd(descriptor) in from_raw_descriptor()
266 let descriptor = unsafe { SafeDescriptor::from_raw_descriptor(ret) }; in clone_equality() localVariable
268 assert_eq!(descriptor, descriptor); in clone_equality()
271 descriptor, in clone_equality()
272 descriptor.try_clone().expect("failed to clone eventfd") in clone_equality()
281 assert_ne!(descriptor, another); in clone_equality()