pub struct Host { /* private fields */ }Expand description
The way back to the recorder: logs, health, results. Cheap to clone and
usable from any thread. (A plugin’s stdout belongs to the protocol — never
println! in a plugin; use this, or eprintln! for the raw log.)
Implementations§
Source§impl Host
impl Host
Sourcepub fn to_writer(w: impl Write + Send + 'static) -> Host
pub fn to_writer(w: impl Write + Send + 'static) -> Host
A host writing to w instead of stdout (see crate::testing).
pub fn send(&self, m: &PluginMessage)
pub fn log(&self, level: Level, message: impl Into<String>)
pub fn error(&self, message: impl Into<String>)
pub fn warn(&self, message: impl Into<String>)
pub fn info(&self, message: impl Into<String>)
pub fn debug(&self, message: impl Into<String>)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Host
impl RefUnwindSafe for Host
impl Send for Host
impl Sync for Host
impl Unpin for Host
impl UnsafeUnpin for Host
impl UnwindSafe for Host
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