mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
parent
fe8ab8a530
commit
28db5214d2
@ -606,6 +606,33 @@ impl Write for Stdout {
|
|||||||
self.lock().write_fmt(args)
|
self.lock().write_fmt(args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[stable(feature = "write_mt", since = "1.47.0")]
|
||||||
|
impl Write for &Stdout {
|
||||||
|
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||||
|
self.lock().write(buf)
|
||||||
|
}
|
||||||
|
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
|
||||||
|
self.lock().write_vectored(bufs)
|
||||||
|
}
|
||||||
|
#[inline]
|
||||||
|
fn is_write_vectored(&self) -> bool {
|
||||||
|
self.lock().is_write_vectored()
|
||||||
|
}
|
||||||
|
fn flush(&mut self) -> io::Result<()> {
|
||||||
|
self.lock().flush()
|
||||||
|
}
|
||||||
|
fn write_all(&mut self, buf: &[u8]) -> io::Result<()> {
|
||||||
|
self.lock().write_all(buf)
|
||||||
|
}
|
||||||
|
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> io::Result<()> {
|
||||||
|
self.lock().write_all_vectored(bufs)
|
||||||
|
}
|
||||||
|
fn write_fmt(&mut self, args: fmt::Arguments<'_>) -> io::Result<()> {
|
||||||
|
self.lock().write_fmt(args)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
impl Write for StdoutLock<'_> {
|
impl Write for StdoutLock<'_> {
|
||||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||||
@ -782,6 +809,33 @@ impl Write for Stderr {
|
|||||||
self.lock().write_fmt(args)
|
self.lock().write_fmt(args)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[stable(feature = "write_mt", since = "1.47.0")]
|
||||||
|
impl Write for &Stderr {
|
||||||
|
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||||
|
self.lock().write(buf)
|
||||||
|
}
|
||||||
|
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
|
||||||
|
self.lock().write_vectored(bufs)
|
||||||
|
}
|
||||||
|
#[inline]
|
||||||
|
fn is_write_vectored(&self) -> bool {
|
||||||
|
self.lock().is_write_vectored()
|
||||||
|
}
|
||||||
|
fn flush(&mut self) -> io::Result<()> {
|
||||||
|
self.lock().flush()
|
||||||
|
}
|
||||||
|
fn write_all(&mut self, buf: &[u8]) -> io::Result<()> {
|
||||||
|
self.lock().write_all(buf)
|
||||||
|
}
|
||||||
|
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> io::Result<()> {
|
||||||
|
self.lock().write_all_vectored(bufs)
|
||||||
|
}
|
||||||
|
fn write_fmt(&mut self, args: fmt::Arguments<'_>) -> io::Result<()> {
|
||||||
|
self.lock().write_fmt(args)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
impl Write for StderrLock<'_> {
|
impl Write for StderrLock<'_> {
|
||||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||||
|
@ -248,6 +248,30 @@ impl Write for Sink {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[stable(feature = "write_mt", since = "1.47.0")]
|
||||||
|
impl Write for &Sink {
|
||||||
|
#[inline]
|
||||||
|
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||||
|
Ok(buf.len())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
|
||||||
|
let total_len = bufs.iter().map(|b| b.len()).sum();
|
||||||
|
Ok(total_len)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn is_write_vectored(&self) -> bool {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn flush(&mut self) -> io::Result<()> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[stable(feature = "std_debug", since = "1.16.0")]
|
#[stable(feature = "std_debug", since = "1.16.0")]
|
||||||
impl fmt::Debug for Sink {
|
impl fmt::Debug for Sink {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
@ -262,6 +262,25 @@ impl Write for ChildStdin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[stable(feature = "write_mt", since = "1.47.0")]
|
||||||
|
impl Write for &ChildStdin {
|
||||||
|
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||||
|
self.inner.write(buf)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
|
||||||
|
self.inner.write_vectored(bufs)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn is_write_vectored(&self) -> bool {
|
||||||
|
self.inner.is_write_vectored()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn flush(&mut self) -> io::Result<()> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl AsInner<AnonPipe> for ChildStdin {
|
impl AsInner<AnonPipe> for ChildStdin {
|
||||||
fn as_inner(&self) -> &AnonPipe {
|
fn as_inner(&self) -> &AnonPipe {
|
||||||
&self.inner
|
&self.inner
|
||||||
|
Loading…
Reference in New Issue
Block a user