Trait TryClone

Source
pub trait TryClone: Sized {
    // Required method
    fn try_clone(&self) -> Result<Self>;
}
Expand description

Fallible OS object cloning.

The DuplicateHandle/dup system calls can fail for a variety of reasons, most of them being related to system resource exhaustion. This trait is implemented by types in Interprocess which wrap OS objects (which is to say, the majority of types here) to enable handle/file descriptor duplication functionality on them.

Required Methods§

Source

fn try_clone(&self) -> Result<Self>

Clones self, possibly returning an error.

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.

Implementors§

Source§

impl TryClone for interprocess::local_socket::Stream

Source§

impl TryClone for ListenerOptions<'_>

Source§

impl TryClone for interprocess::os::unix::uds_local_socket::Stream

Available on Unix only.
Source§

impl<T: Clone> TryClone for T