pub struct ReportBuilder {
report: Report,
pending_labels: Vec<String>,
}Expand description
Fluent builder for a Report. Finalise with ReportBuilder::build.
Fields§
§report: Report§pending_labels: Vec<String>Implementations§
Source§impl ReportBuilder
impl ReportBuilder
Sourcepub fn new(
plugin_id: impl Into<String>,
plugin_version: impl Into<String>,
) -> Self
pub fn new( plugin_id: impl Into<String>, plugin_version: impl Into<String>, ) -> Self
Start a new report for a plugin. id and version typically come
from env!("CARGO_PKG_NAME") / env!("CARGO_PKG_VERSION").
Sourcepub fn display_name(self, name: impl Into<String>) -> Self
pub fn display_name(self, name: impl Into<String>) -> Self
Set a human-friendly plugin name for the frontend (e.g. "YARA Scanner").
Sourcepub fn summary(self, summary: impl Into<String>) -> Self
pub fn summary(self, summary: impl Into<String>) -> Self
Set a short summary shown at the top of the report.
Sourcepub fn verdict(
self,
classification: Classification,
score: Option<u8>,
confidence: Option<Confidence>,
) -> Self
pub fn verdict( self, classification: Classification, score: Option<u8>, confidence: Option<Confidence>, ) -> Self
Set the verdict. score is optional (pass None when the plugin
has no numeric score). Can be called before or after labels.
Sourcepub fn indicator(self, ind: Indicator) -> Self
pub fn indicator(self, ind: Indicator) -> Self
Add an indicator of compromise to the report’s semantic layer.
Sourcepub fn artifact(self, artifact: ArtifactRef) -> Self
pub fn artifact(self, artifact: ArtifactRef) -> Self
Register a sibling PluginResult as an artifact.
Sourcepub fn section<F>(
self,
id: impl Into<String>,
title: impl Into<String>,
build: F,
) -> Self
pub fn section<F>( self, id: impl Into<String>, title: impl Into<String>, build: F, ) -> Self
Append a section. The closure receives a SectionBuilder and
returns it - the typical shape is |s| s.heading(2, "...").table(...).
Auto Trait Implementations§
impl Freeze for ReportBuilder
impl RefUnwindSafe for ReportBuilder
impl Send for ReportBuilder
impl Sync for ReportBuilder
impl Unpin for ReportBuilder
impl UnsafeUnpin for ReportBuilder
impl UnwindSafe for ReportBuilder
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].