Skip to main content

DraftConfig

Struct DraftConfig 

Source
pub struct DraftConfig {
Show 15 fields pub max_fields: usize, pub min_fields: usize, pub min_prevalence: f64, pub max_value_cardinality: usize, pub min_token_len: usize, pub max_baseline_token_prevalence: f64, pub include_fields: Vec<String>, pub exclude_fields: Vec<String>, pub title: Option<String>, pub rule_id: Option<String>, pub date: Option<String>, pub logsource_category: Option<String>, pub logsource_product: Option<String>, pub logsource_service: Option<String>, pub evaluate_baseline: bool,
}
Expand description

Tunables for a draft run. Default is a sensible starting point; the CLI exposes each as a flag.

Fields§

§max_fields: usize

Maximum fields in a selection. Kept small so drafts stay readable.

§min_fields: usize

Relaxation floor: verification may drop failing fields down to this count, below it drafting errors instead of emitting an over-broad rule.

§min_prevalence: f64

Fraction (0.0-1.0) of exemplars a field must appear in to be a candidate. The default 1.0 keeps AND-selections sound.

§max_value_cardinality: usize

A field whose distinct exemplar values do not exceed this cap is “enumerable” and emitted as an OR value list.

§min_token_len: usize

Minimum length of a shared prefix/suffix/token before it becomes a startswith/endswith/contains pattern, so short generic fragments are never chosen.

§max_baseline_token_prevalence: f64

A contains token matching more than this fraction of baseline events is rejected as too generic.

§include_fields: Vec<String>

Force these fields into the selection (a warning is recorded when a forced field is absent from some exemplars).

§exclude_fields: Vec<String>

Never consider these fields.

§title: Option<String>

Rule title override; derived from the dominant marker when unset.

§rule_id: Option<String>

Rule id. The core is deterministic and never generates one; the CLI passes a fresh UUIDv4. Unset omits the id key (lint reports it).

§date: Option<String>

Rule date (YYYY-MM-DD). Defaults to today (UTC) when unset; tests pass a fixed date for byte-identical output.

§logsource_category: Option<String>

Logsource overrides; each set dimension wins over inference.

§logsource_product: Option<String>§logsource_service: Option<String>§evaluate_baseline: bool

Evaluate the final draft against the baseline (the baseline is still used for contrastive scoring when this is off).

Trait Implementations§

Source§

impl Clone for DraftConfig

Source§

fn clone(&self) -> DraftConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DraftConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DraftConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.