Skip to main content

PocketIcDiagnosticsExt

Trait PocketIcDiagnosticsExt 

Source
pub trait PocketIcDiagnosticsExt {
    // Required method
    async fn collect_canister_diagnostics(
        &self,
        request: CanisterDiagnosticsRequest,
    ) -> CanisterDiagnosticsReport;

    // Provided methods
    async fn write_canister_diagnostics(
        &self,
        request: CanisterDiagnosticsRequest,
        context: &str,
        writer: &mut dyn Write,
    ) -> Result<()> { ... }
    async fn collect_canister_diagnostics_batch(
        &self,
        requests: &[LabeledCanisterDiagnosticsRequest],
    ) -> Result<CanisterDiagnosticsBatchReport, BatchLabelError> { ... }
}
Expand description

Reusable structured PocketIC failure diagnostics.

Required Methods§

Source

async fn collect_canister_diagnostics( &self, request: CanisterDiagnosticsRequest, ) -> CanisterDiagnosticsReport

Collect status and bounded logs using the request’s exact senders.

Both calls are attempted independently. Typed client failures remain in the report so diagnostics can stay subordinate to the original failure.

Provided Methods§

Source

async fn write_canister_diagnostics( &self, request: CanisterDiagnosticsRequest, context: &str, writer: &mut dyn Write, ) -> Result<()>

Explicitly collect and write one contextual diagnostic report.

Uses the request’s exact senders and log limits, with no retry or output destination selected implicitly. Unrelated collection/formatting/writer panics propagate. Ordinary writer errors are returned unchanged. Status/log failures remain in the written report; successful output does not mean those calls passed. Callers keep their primary failure authoritative and decide whether to retain or ignore this secondary reporting result.

§Errors

Returns the writer’s I/O error when diagnostics cannot be written.

Source

async fn collect_canister_diagnostics_batch( &self, requests: &[LabeledCanisterDiagnosticsRequest], ) -> Result<CanisterDiagnosticsBatchReport, BatchLabelError>

Collect every labeled request sequentially in its supplied order.

Every target is attempted even when an earlier entry has client failures. Each entry preserves its exact request and independent status/log outcomes; no anonymous retry or fallback is performed. Invalid labels return Host’s BatchLabelError before collection starts.

§Errors

Rejects invalid or duplicate labels before collecting diagnostics.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§