Skip to main content

SectionBuilder

Struct SectionBuilder 

Source
pub struct SectionBuilder {
    section: Section,
}
Expand description

Builder for a single Section. One method per Block variant, plus a block(...) escape hatch for forward compatibility.

Fields§

§section: Section

Implementations§

Source§

impl SectionBuilder

Source

pub(crate) fn new(id: impl Into<String>, title: impl Into<String>) -> Self

Source

pub fn block(self, block: Block) -> Self

Escape hatch - push any Block directly.

Source

pub fn markdown(self, text: impl Into<String>) -> Self

Add a markdown text block.

Source

pub fn callout(self, level: CalloutLevel, text: impl Into<String>) -> Self

Add a highlighted callout box with a severity level.

Source

pub fn heading(self, level: u8, text: impl Into<String>) -> Self

Add a heading (level 1-6, maps to HTML heading levels).

Source

pub fn divider(self) -> Self

Add a horizontal divider.

Source

pub fn kv(self, pairs: impl IntoIterator<Item = KvPair>) -> Self

Add a key-value list.

Source

pub fn table( self, columns: impl IntoIterator<Item = Column>, rows: impl IntoIterator<Item = Value>, ) -> Self

Add a data table. Sortable by default, not searchable.

Source

pub fn code(self, language: impl Into<String>, text: impl Into<String>) -> Self

Add a syntax-highlighted code block.

Source

pub fn json(self, data: impl Serialize) -> Self

Add an interactive JSON tree viewer (collapsed by default).

Source

pub fn hex(self, bytes_b64: impl Into<String>, offset: u64) -> Self

Add a hex dump. bytes_b64 is the data as base64, offset is the starting address.

Source

pub fn image(self, artifact: impl Into<String>, caption: Option<String>) -> Self

Add an inline image resolved from a sibling artifact result.

Source

pub fn download( self, artifact: impl Into<String>, label: impl Into<String>, ) -> Self

Add a download link resolved from a sibling artifact result.

Source

pub fn iocs(self, items: impl IntoIterator<Item = Indicator>) -> Self

Add a formatted IOC list.

Source

pub fn ttps(self, items: impl IntoIterator<Item = Ttp>) -> Self

Add a formatted MITRE ATT&CK technique list.

Source

pub fn tree(self, nodes: impl IntoIterator<Item = TreeNode>) -> Self

Add a collapsible tree (e.g. process tree, file hierarchy).

Source

pub fn timeline(self, events: impl IntoIterator<Item = TimelineEvent>) -> Self

Add a chronological event timeline.

Source

pub fn graph( self, nodes: impl IntoIterator<Item = GraphNode>, edges: impl IntoIterator<Item = GraphEdge>, ) -> Self

Add a node-and-edge graph (e.g. network map, call graph).

Source

pub(crate) fn build(self) -> Section

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

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].
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more