Certain FIDL types can be made optional with no change to the wire shape of their containing message with the addition of the :optional constraint. Further, the table layout is always optional, while the struct layout never is. To make a struct optional, it must be wrapped in a box<T>, thereby changing the wire shape of its containing message.

Base typeOptional versionDoes optionality change the wire layout?
struct {...}box<struct {...}>Yes
table {...}table {...}No
union {...}union {...}:optionalNo
vector<T>vector<T>:optionalNo
stringstring:optionalNo
zx.Handlezx.Handle:optionalNo
client_end:Pclient_end:<P, optional>No
server_end:Pserver_end:<P, optional>No

All other types (bits, enum, array<T, N>, and the primitive types) cannot be made optional.

<<../examples/key_value_store/_callout.md>> <<../examples/key_value_store/_support_trees_tutorial.md>>