pub struct DoctorReport { /* private fields */ }Expand description
Structured doctor report reusable for text and JSON output.
Implementations§
Source§impl DoctorReport
impl DoctorReport
Sourcepub fn for_tool<T: DoctorChecks>(tool: &T) -> Self
pub fn for_tool<T: DoctorChecks>(tool: &T) -> Self
Create a doctor report scaffold for a tool using the standard header, version, and checks.
Sourcepub fn with_tool_header<T: DoctorChecks>(
tool: &T,
header: impl Into<String>,
) -> Self
pub fn with_tool_header<T: DoctorChecks>( tool: &T, header: impl Into<String>, ) -> Self
Create a doctor report scaffold for a tool with a caller-provided header.
Sourcepub fn with_checks(self, checks: Vec<DoctorCheck>) -> Self
pub fn with_checks(self, checks: Vec<DoctorCheck>) -> Self
Set the report checks.
Sourcepub fn with_version(self, version: impl Into<String>) -> Self
pub fn with_version(self, version: impl Into<String>) -> Self
Set the reported version string.
Sourcepub fn with_error(self, error: impl Into<String>) -> Self
pub fn with_error(self, error: impl Into<String>) -> Self
Add an error line.
Sourcepub fn with_warning(self, warning: impl Into<String>) -> Self
pub fn with_warning(self, warning: impl Into<String>) -> Self
Add a warning line.
Sourcepub fn with_detail(self, key: impl Into<String>, value: Value) -> Self
pub fn with_detail(self, key: impl Into<String>, value: Value) -> Self
Add a custom JSON detail field.
Sourcepub fn checks(&self) -> &[DoctorCheck]
pub fn checks(&self) -> &[DoctorCheck]
Access the underlying checks.
Sourcepub fn to_json_value(&self) -> Value
pub fn to_json_value(&self) -> Value
Render the report as JSON.
Sourcepub fn render_text(&self) -> String
pub fn render_text(&self) -> String
Render the report as plain text.
Trait Implementations§
Source§impl Clone for DoctorReport
impl Clone for DoctorReport
Source§fn clone(&self) -> DoctorReport
fn clone(&self) -> DoctorReport
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DoctorReport
impl RefUnwindSafe for DoctorReport
impl Send for DoctorReport
impl Sync for DoctorReport
impl Unpin for DoctorReport
impl UnsafeUnpin for DoctorReport
impl UnwindSafe for DoctorReport
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