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>)
Sourcepub fn status(&self, state: State, message: impl Into<String>)
pub fn status(&self, state: State, message: impl Into<String>)
The plugin’s health, shown in the interface until the next.
Sourcepub fn metrics(&self, m: &Metrics)
pub fn metrics(&self, m: &Metrics)
How the plugin’s work is going (see Metrics): queue, timing,
the services it talks to. At most every few seconds.
Sourcepub fn call_result(
&self,
path: &str,
outcome: Outcome,
message: impl Into<String>,
url: impl Into<String>,
)
pub fn call_result( &self, path: &str, outcome: Outcome, message: impl Into<String>, url: impl Into<String>, )
What became of a concluded call.
Sourcepub fn call_result_took(
&self,
path: &str,
outcome: Outcome,
message: impl Into<String>,
url: impl Into<String>,
took: Duration,
)
pub fn call_result_took( &self, path: &str, outcome: Outcome, message: impl Into<String>, url: impl Into<String>, took: Duration, )
The same, and how long the work on it took (an upload’s last try):
the recorder tells waiting from uploading by it. crate::CallQueue
says it for you.
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