Skip to main content

check_support

Function check_support 

Source
pub fn check_support(
    schema: &CompiledSchema,
    targets: &[Target],
) -> Result<(), String>
Expand description

Reject a schema a requested target cannot yet emit correctly, before any code is generated.

Only the rust and typescript targets emit data-carrying (tagged) unions; the python target emits string enums only and would silently drop the payloads. The rust target also cannot emit a reference cycle its boxing does not break (mutual recursion), which would produce infinitely-sized Rust. Returning a clear error here turns both silent failures into an actionable message. Targets that handle the schema impose no restriction.