pub trait ManagedFD{
// Required methods
fn wrap(fd: RawFd) -> Self;
fn dup_wrap(fd: RawFd) -> Result<Self>;
fn dup(&self) -> Result<Self>;
}Expand description
Trait ManagedFD describes a managed std::os::unix::io::RawFd, with primary functionality of
auto-closing on drop and performing sensible clone()/dup() operations.
Warning: Clone trait has no way to convey errors, so implementations are forced to panic!().
Required Methods§
Sourcefn wrap(fd: RawFd) -> Self
fn wrap(fd: RawFd) -> Self
Wrap fd in ManagedFD. You should not use naked handle afterwards, in particular don’t
close it.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.