Skip to main content

ProxyTarget

Trait ProxyTarget 

Source
pub trait ProxyTarget {
    // Required methods
    fn proxy_write(&mut self, stream: ProxyStream, bytes: &[u8]) -> bool;
    fn proxy_flush(&mut self, stream: ProxyStream) -> bool;
}
Expand description

A live display a FileProxy can print through.

Implemented for &mut Live<W> and for the LiveHandle of a display on a refresh thread. Each method returns false when the display is not redirecting stream, and the proxy then writes to its file instead.

Required Methods§

Source

fn proxy_write(&mut self, stream: ProxyStream, bytes: &[u8]) -> bool

Upstream’s FileProxy.write: buffer bytes and print every completed line through the display.

Source

fn proxy_flush(&mut self, stream: ProxyStream) -> bool

Upstream’s FileProxy.flush: print a buffered partial line.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<W: Write + Send + 'static> ProxyTarget for LiveHandle<W>

Source§

impl<W: Write> ProxyTarget for &mut Live<W>