pub struct Baseline {
pub note: String,
pub format: u32,
pub source: Source,
pub base_event_fields: Vec<Field>,
pub event_types: Vec<String>,
pub events: Vec<Event>,
}Fields§
§note: String§format: u32§source: Source§base_event_fields: Vec<Field>Fields every event inherits from BaseEventSchema. Kept out of the
per-event field lists, where they would be repeated 36 times, and
compared once against the Rust BaseEvent instead.
event_types: Vec<String>EventType values in upstream declaration order.
events: Vec<Event>One entry per event type, same order.
Implementations§
Source§impl Baseline
impl Baseline
Sourcepub fn from_upstream(up: &Upstream, source: Source) -> Self
pub fn from_upstream(up: &Upstream, source: Source) -> Self
Builds a baseline from a freshly extracted upstream surface.
pub fn load(path: &Path) -> Result<Self, String>
Sourcefn validate(&self) -> Result<(), String>
fn validate(&self) -> Result<(), String>
Refuses to persist a snapshot that cannot do the job of a baseline.
--refresh replaces a human-reviewed file with whatever came back over
the network, and the dangerous failure is not a loud one. A response
truncated after the EventType enum but before the schemas parses
perfectly well: every event type is still found, every schema is
recorded unparsed, and because unparsed schemas are deliberately
warnings rather than failures, the resulting baseline agrees with any
Rust source at all. The gate would go quiet instead of going red, which
is the one outcome this crate exists to prevent.
So a baseline must name at least one event type, carry one entry per event type, and have read a majority of the schemas. A healthy capture reads all of them; half is slack for upstream reformatting, not for a half-delivered file.