Skip to content

Declared in <galanthus/c_api/gln_capi.h>.

GLN_API const char* GLN_CALL gln_get_backend_result_opaque_json(const gln_backend_result_t* in_result);
  • Family: Backend result accessors
  • Return type: const char*

Purpose

Returns the opaque JSON payload carried by a backend result envelope when the result kind is GLN_BACKEND_RESULT_KIND_OPAQUE_JSON.

The returned string is borrowed from the parent envelope and becomes invalid when gln_destroy_backend_result releases that envelope. It returns NULL when the envelope is not an opaque JSON result.

Return

Returns the opaque JSON payload carried by a backend result envelope when the result kind is GLN_BACKEND_RESULT_KIND_OPAQUE_JSON.

TypeNullabilityOwnership
const char*nullableborrowed

Parameters

NameDirectionTypeNullabilityOwnership
in_resultinputconst gln_backend_result_t*nullableborrowed

JSON Payload Semantics

Returns a borrowed pointer to the opaque JSON payload stored in the envelope. The accessor requires result kind GLN_BACKEND_RESULT_KIND_OPAQUE_JSON.

Typed success envelopes do not carry an opaque JSON payload. Consume typed results through the matching typed accessor for their result kind.

NULL means either in_result is NULL or the envelope kind is not GLN_BACKEND_RESULT_KIND_OPAQUE_JSON.

Notes

Passing NULL for in_result is allowed and returns NULL.

See Also