Skip to main content

ExceptionReporter

Trait ExceptionReporter 

Source
pub trait ExceptionReporter: Send + Sync {
    // Required method
    fn report<'life0, 'life1, 'async_trait>(
        &'life0 self,
        batch: &'life1 ExceptionBatch,
    ) -> Pin<Box<dyn Future<Output = CollectorResult<ReportResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn check_available<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

异常上报器 trait。

定义异常批次上报的统一接口。不同的上报路径 (GitHub Issue、自研平台)实现此 trait。

Required Methods§

Source

fn report<'life0, 'life1, 'async_trait>( &'life0 self, batch: &'life1 ExceptionBatch, ) -> Pin<Box<dyn Future<Output = CollectorResult<ReportResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

上报一个异常批次。

§Errors

当上报过程发生不可恢复的错误时返回 CollectorError

Provided Methods§

Source

fn check_available<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

检查此 reporter 是否可用。

例如 GitHubReporter 检查 gh CLI 是否在 PATH 中, CustomPlatformReporter 检查 endpoint 是否已配置。

默认返回 true

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§