Skip to main content

LiveHandle

Struct LiveHandle 

Source
pub struct LiveHandle<W: Write> { /* private fields */ }
Expand description

A cloneable, Send handle to an AutoLive’s refresh thread, used by the FileProxy writers it hands out. Once the display has stopped, proxies built on it write to their files, as upstream’s restored sys.stdout does.

Implementations§

Source§

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

Source

pub fn print(&self, renderable: Box<dyn Renderable + Send>)

Live::print on the refresh thread.

Source

pub fn print_str(&self, content: impl Into<String>)

Live::print_str on the refresh thread.

Source

pub fn log( &self, objects: &[LogObject<'_>], options: &LogOptions<'_>, ) -> Result<()>

Live::log on the refresh thread. A log queued from the thread holding the renderable’s lock (see run) reports no error.

Source

pub fn log_at( &self, objects: &[LogObject<'_>], options: &LogOptions<'_>, file: &str, line: u32, ) -> Result<()>

log with the caller’s file and line given.

Source

pub fn file_proxy<F: Write>( &self, stream: ProxyStream, file: F, ) -> FileProxy<Self, F> ⓘ

A proxy for stream over file.

Trait Implementations§

Source§

impl<W: Write> Clone for LiveHandle<W>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

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

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.

Auto Trait Implementations§

§

impl<W> Freeze for LiveHandle<W>
where Option<Sender<LiveMessage<W>>>: Freeze,

§

impl<W> RefUnwindSafe for LiveHandle<W>
where Option<Sender<LiveMessage<W>>>: RefUnwindSafe,

§

impl<W> Send for LiveHandle<W>
where Option<Sender<LiveMessage<W>>>: Send,

§

impl<W> Sync for LiveHandle<W>
where Option<Sender<LiveMessage<W>>>: Sync,

§

impl<W> Unpin for LiveHandle<W>
where Option<Sender<LiveMessage<W>>>: Unpin,

§

impl<W> UnsafeUnpin for LiveHandle<W>
where Option<Sender<LiveMessage<W>>>: UnsafeUnpin,

§

impl<W> UnwindSafe for LiveHandle<W>
where Option<Sender<LiveMessage<W>>>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.