Skip to main content

Crate lenso_contract_codegen

Crate lenso_contract_codegen 

Source
Expand description

Portable Capability Descriptor validation and binding generation.

A locked Descriptor and its package-local JSON Schemas are the portable cross-language authority. They may be derived from compiled source types, but every backend consumes the same checked snapshot. This crate deliberately lives above the Kernel: it checks evolution rules and emits deterministic Rust and TypeScript artifacts before an App is booted.

Structs§

Descriptor
A validated, self-contained portable Capability Descriptor.
GeneratedArtifacts
Compatibility aggregate for callers that intentionally generate both projections.
GeneratedMetadata
Metadata embedded in every generated language artifact.
GeneratedProjection
One independently generated language projection.

Enums§

CodegenError
Errors produced while parsing, validating, or generating a contract.
CompatibilityError
Reasons why a Descriptor evolution is not safe for an existing Capability series.
ProjectionLanguage
One language projection emitted from a portable Capability contract.

Functions§

check_generated
Fails when either checked-in artifact is not exactly reproducible.
check_projection
Fails when one selected language projection is not exactly reproducible.
check_source_snapshot
Fails unless every committed Descriptor and Schema byte matches compiled source.
generate
Generates both language artifacts from one Descriptor source.
generate_browser_request_client
Generates an executable browser request client from the same validated Descriptor IR used by the checked-in Rust and TypeScript bindings.
generate_projection
Generates one selected language projection from a Descriptor source.
lint_compatibility
Checks whether new_path is an additive, compatible evolution of old_path. true means the same Capability series remains compatible.
load_descriptor
Reads and validates one Descriptor, resolving package-local $ref files.
round_trip_portable_json
Round-trips one JSON value through the portable wire representation.
validate_wire_value
Validates a wire value against a package-local JSON Schema.
write_generated
Writes generated artifacts to checked-in paths.
write_projection
Writes one selected language projection to a checked-in path.
write_source_snapshot
Writes one Descriptor and its package-local Schemas from compiled source types.