pub struct Config { /* private fields */ }Expand description
Build-script entry point.
Implementations§
Source§impl Config
impl Config
Sourcepub fn include(self, dir: impl AsRef<Path>) -> Self
pub fn include(self, dir: impl AsRef<Path>) -> Self
Add include directories searched by protoc.
Sourcepub fn out_dir(self, dir: impl AsRef<Path>) -> Self
pub fn out_dir(self, dir: impl AsRef<Path>) -> Self
Override the output directory. Defaults to $OUT_DIR.
Sourcepub fn include_obs_options(self) -> Self
pub fn include_obs_options(self) -> Self
Pull obs/v1/options.proto from the embedded obs-build
package so the user does not need to vendor it. The proto file
is bundled at compile time and extracted to $OUT_DIR/obs/include/.
Sourcepub fn descriptor_source(self, src: DescriptorSource) -> Self
pub fn descriptor_source(self, src: DescriptorSource) -> Self
Use a pre-compiled FDS file (skips protoc).
Sourcepub fn event_prefix(self, prefix: impl Into<String>) -> Self
pub fn event_prefix(self, prefix: impl Into<String>) -> Self
Override the workspace event prefix used by lint L011. Defaults
to reading OBS_EVENT_PREFIX env var, then falling back to
"Obs". Spec 12 § 3.4.
Sourcepub fn with_arrow_schema(self, on: bool) -> Self
pub fn with_arrow_schema(self, on: bool) -> Self
Toggle Arrow schema fragment emission. On by default. Spec 12 § 4.
Sourcepub fn with_json_render(self, on: bool) -> Self
pub fn with_json_render(self, on: bool) -> Self
Toggle JSON-render dispatcher. Off by default; lands in Phase 4. Spec 12 § 4.
Sourcepub fn with_payload_scrub(self, on: bool) -> Self
pub fn with_payload_scrub(self, on: bool) -> Self
Toggle payload scrub dispatcher. On by default. Spec 12 § 4.
Sourcepub fn with_otel_attribute_view(self, on: bool) -> Self
pub fn with_otel_attribute_view(self, on: bool) -> Self
Toggle OTel attribute view emission. On by default. Spec 12 § 4.
Sourcepub fn compile(self) -> Result<(), CodegenError>
pub fn compile(self) -> Result<(), CodegenError>
Run codegen.
Two-stage pipeline per spec 12 § 3:
- Stage 1 —
buffa-build: compile the.protofiles into Rust wire types under$OUT_DIR/obs_buffa.rs(one entry-point file viainclude_file). Skipped when the user pre-built the FDS viadescriptor_source(Precompiled(_))and there are no.protofiles set onConfig(the test path). - Stage 2 — obs codegen: read
(obs.v1.event)/(obs.v1.field)annotations from the descriptor pool and emit$OUT_DIR/obs/{schemas,builders,lints,arrow_schema}.rs.
§Errors
Returns CodegenError for any step that fails: protoc
invocation, buffa-build invocation, FDS decode, option scan,
generated-file IO.