pub struct FileProxy<T: ProxyTarget, F: Write> { /* private fields */ }Expand description
A writer that sends text through a live display. Mirrors
rich.file_proxy.FileProxy; the line buffer lives in the display, so a
partial line survives from one proxy to the next, as it does on the one
sys.stdout upstream.
Implementations§
Source§impl<T: ProxyTarget, F: Write> FileProxy<T, F>
impl<T: ProxyTarget, F: Write> FileProxy<T, F>
Sourcepub fn new(target: T, stream: ProxyStream, file: F) -> Self
pub fn new(target: T, stream: ProxyStream, file: F) -> Self
A proxy for stream that prints through target, writing to file
when the display is not redirecting.
Sourcepub fn rich_proxied_file(&self) -> &F
pub fn rich_proxied_file(&self) -> &F
The proxied file. Port of FileProxy.rich_proxied_file; Python’s
fileno and isatty forward to it, which here is the caller’s to do.
Sourcepub fn stream(&self) -> ProxyStream
pub fn stream(&self) -> ProxyStream
Which stream this proxy stands in for.
Sourcepub fn into_inner(self) -> F
pub fn into_inner(self) -> F
Consume the proxy, returning the proxied file.
Trait Implementations§
Source§impl<T: ProxyTarget, F: Write> Write for FileProxy<T, F>
impl<T: ProxyTarget, F: Write> Write for FileProxy<T, F>
Source§fn write(&mut self, bytes: &[u8]) -> Result<usize>
fn write(&mut self, bytes: &[u8]) -> Result<usize>
Writes a buffer into this writer, returning how many bytes were written. Read more
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flushes this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector)1.0.0 · Source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
Source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
🔬This is a nightly-only experimental API. (
write_all_vectored)Attempts to write multiple buffers into this writer. Read more
Auto Trait Implementations§
impl<T, F> Freeze for FileProxy<T, F>
impl<T, F> RefUnwindSafe for FileProxy<T, F>where
T: RefUnwindSafe,
F: RefUnwindSafe,
impl<T, F> Send for FileProxy<T, F>
impl<T, F> Sync for FileProxy<T, F>
impl<T, F> Unpin for FileProxy<T, F>
impl<T, F> UnsafeUnpin for FileProxy<T, F>where
T: UnsafeUnpin,
F: UnsafeUnpin,
impl<T, F> UnwindSafe for FileProxy<T, F>where
T: UnwindSafe,
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more