Skip to main content

Module unstructured

Module unstructured 

Source
Expand description

Canonical “unstructured” text/binary carriers.

Unstructured text/binary fields are represented as a role-marked variant { inline, url } wrapper (or, accepted on input, a bare Text / Binary rich scalar). This module is the single home for building, detecting, and decoding that canonical shape.

Structs§

UnstructuredError
Error produced while building, detecting, or decoding a canonical unstructured text/binary carrier.

Enums§

UnstructuredKind
Which flavour of unstructured wrapper a type is, together with the inline case’s restrictions.
UnstructuredOutput
A decoded unstructured output value, classified against its schema.
UnstructuredPayloadKind
Which flavour of unstructured payload a type is, irrespective of whether it is carried by a canonical variant { inline, url } wrapper or a bare Text / Binary rich scalar.
UnstructuredValueCase
The selected case of a canonical unstructured variant { inline, url } value.

Constants§

INLINE_CASE
URL_CASE
The case index of the url alternative in the canonical variant.

Functions§

binary_body_restrictions
Read the binary restrictions from a request/response body root that is known to carry unstructured binary — either the canonical variant { inline, url } wrapper or a bare Binary rich scalar.
decode_unstructured_output
Decode an unstructured output value against its schema ty, accepting both the canonical variant { inline, url } wrapper and a bare Text / Binary rich scalar, and validating that the runtime value matches the declared schema kind.
decode_unstructured_value
Interpret a SchemaValue as a canonical unstructured variant { inline, url } value, returning the selected case.
is_unstructured_variant
Whether ty is itself a role-marked unstructured-text/binary variant.
text_body_restrictions
Read the text restrictions from a request/response body root that is known to carry unstructured text — either the canonical variant { inline, url } wrapper or a bare Text rich scalar.
unstructured_binary_restrictions
If ty (resolved against graph) is the canonical role-marked unstructured-binary variant, return the inline binary restrictions.
unstructured_binary_schema_type
Build the canonical role-marked unstructured-binary variant variant { inline: binary<restrictions>, url: url } with Role::UnstructuredBinary.
unstructured_inline_value
Build a canonical unstructured inline value (case 0) wrapping the inner text / binary value payload.
unstructured_kind
If ty (resolved against graph) is a canonical role-marked unstructured variant, classify it as text or binary and return the inline restrictions.
unstructured_or_raw_kind
Classify ty (resolved against graph) as an unstructured text/binary payload — either a canonical variant { inline, url } wrapper or a bare Text / Binary rich scalar — returning which flavour, or None.
unstructured_text_restrictions
If ty (resolved against graph) is the canonical role-marked unstructured-text variant, return the inline text restrictions.
unstructured_text_schema_type
Build the canonical role-marked unstructured-text variant variant { inline: text<restrictions>, url: url } with Role::UnstructuredText.
unstructured_url_value
Build a canonical unstructured url value (case 1).
wrap_unstructured_inline_for_schema
Wrap a raw text / binary value as the canonical unstructured inline case (case 0) when ty (resolved against graph) is an unstructured variant { inline, url } wrapper; otherwise return the raw value unchanged (for a bare Text / Binary rich scalar).