Closed
Description
The implementations of Write
which are MT-safe under the covers can implement a trait along the lines of
impl Write for &'_ Self { ... }
and some already do:
impl<'a> Write for &'a UnixStream { ... }
impl<'_> Write for &'_ TcpStream { ... }
impl<'_> Write for &'_ File { ... }
However, these appear to be the extent of the current implementations. The following types could also do the same:
Sink
– does not inspect data andWrite
methods are a no-op;Stdin
/Stdout
– internally aMutex
(and even if theMutex
was removed in the future, the underlying syscalls are MT-safe – much like they are for a regularFile
);ChildStdin
– similar toFile
or*Stream
s;