---
title: "QuartzUIStructCodec: declaration reference"
description: "Quartz UI 0.57.0-dev: QuartzUIStructCodec: declaration reference. Source-reviewed guidance, usage and limitations."
status: approved
visibility: public
sourceRevision: fe5b709ec900e282b50e58b819a25041945005f9
reviewedAt: 2026-09-24
---

# QuartzUIStructCodec: declaration reference

> **0.57.0-dev · beta source documentation.** Native, Blueprint, Editor and rendering examples are source-reviewed, not executed in Unreal during this scan. See [validation and limits](https://betterbuilt.games/docs/quartz-ui/evidence).

Pinned source (source: `Source/QuartzUIRuntime/Public/QuartzUIStructCodec.h`) · [integration recipe](https://betterbuilt.games/docs/quartz-ui/inventory#quartzuistructcodec) · [practical guide](https://betterbuilt.games/docs/quartz-ui/providers-contracts)

## FQuartzUIStructCodec

**Internal type.** Strict bounded JSON decoder paired with FQuartzUIStructPayload's encoder.

**Prerequisites / integration:** Configured app, explicit reflected value types, saved assets and freshly generated app contract. Use the [QuartzUIStructCodec recipe](https://betterbuilt.games/docs/quartz-ui/inventory#quartzuistructcodec) in the host module `QuartzUIRuntime`.

**Minimal example / lifecycle:** Use Bind Typed UI Endpoint and Instanced Struct payloads. Temporary copied DTO values; no object reference transport.

**Avoid:** Confusing simple payload serializer with declared contract decoding. This named helper is runtime-owned; inspect/use it through the owner above rather than constructing it in gameplay.

Exact source line (source: `Source/QuartzUIRuntime/Public/QuartzUIStructCodec.h#L9`)

## Complete header

Source snapshot, not an additional example. Unreal annotations distinguish exposed Blueprint nodes from native-only/private methods.

```cpp
#pragma once

#include "CoreMinimal.h"
#include "StructUtils/InstancedStruct.h"

class UScriptStruct;

/** Strict bounded JSON decoder paired with FQuartzUIStructPayload's encoder. */
class QUARTZUIRUNTIME_API FQuartzUIStructCodec final
{
public:
	/** Decodes exactly the declared DTO; unknown/missing/type-mismatched fields fail. */
	static bool TryDeserialize(
		const UScriptStruct* StructType,
		const FString& PayloadJson,
		FInstancedStruct& OutValue,
		FString& OutError);

	/** Encodes only an initialized exact data-only struct instance. */
	static bool TrySerialize(
		const FInstancedStruct& Value,
		FString& OutPayloadJson,
		FString& OutError);
};
```

Canonical HTML: https://betterbuilt.games/docs/quartz-ui/reference-quartzuistructcodec
