Expand description
Envelope construction and projection helpers.
Spec 10 § 6 defines the wire envelope (obs.v1.ObsEnvelope); this
module provides the typed EventSchema trait that codegen targets,
the Envelope newtype around the wire envelope (so tests can
manipulate it without going through buffa), and the
build_envelope / project helpers used by the emit hot path
(spec 11 § 5).
Structs§
- Envelope
- Newtype wrapper around the wire
ObsEnvelopeso tests and downstream code don’t depend directly on the buffa-generated type’sDefault + Cloneshape (which is private toobs-proto’s codegen boundary). - Field
Meta - Compile-time field metadata emitted by codegen alongside each
EventSchemaimpl. Mirrors the proto-sideobs.v1.FieldMeta.
Enums§
- Field
Role - Codegen-derived classification of a field. Decoupled from the
FieldKindenum so codegen can stamp this from the descriptor without re-parsing.
Traits§
- Event
Schema - Trait implemented by every
Obs*event type.
Functions§
- build_
envelope - Build an envelope for the given event using its declared default
severity. The payload is encoded into a thread-local scratch buffer
and copied into the envelope’s
payloadfield; labels and lifted fields are still empty here —project()runs next on the emit path. - build_
envelope_ at - Like
build_envelopebut with a caller-specified severity (used byemit_at(sev)).