thrift_runtime_native (thrift_runtime v0.7.0)

View Source

EEP-79 native records for the representation axis (thrift_runtime:repr() value native).

Native records exist from OTP 29 on, while this runtime keeps minimum_otp_vsn on 28, so every reference to the records module and to the is_record/1 BIF lives behind a -if(?OTP_RELEASE >= 29) conditional: older releases compile the stub branch, where is_native/1 answers false and the conversions raise native_records_unsupported. The facade turns the gate into {error, {unsupported_repr, native}} before any conversion runs.

The runtime never compiles record definitions: values are minted with records:create/4 from the wire field map (all declared fields present, missing wire fields as undefined), stamped with the descriptor's module and the lowercased struct name — the same tag a tuple record of that struct carries. Values are created exported, since they are handed out of the module that decoded them.

Summary

Functions

Raises: native records cannot be created before OTP 29.

Raises: no native record can exist before OTP 29.

Always false: native records need OTP 29.

Answers whether this OTP carries native records (EEP-79, OTP 29+).

Types

native_record()

-opaque native_record()

Functions

create(Module, Name, FieldValues)

-spec create(module(), atom(), [{atom(), term()}]) -> no_return().

Raises: native records cannot be created before OTP 29.

fields(Record)

-spec fields(native_record()) -> no_return().

Raises: no native record can exist before OTP 29.

is_native(Term)

-spec is_native(term()) -> boolean().

Always false: native records need OTP 29.

supported()

-spec supported() -> boolean().

Answers whether this OTP carries native records (EEP-79, OTP 29+).