This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Enum
ToClientTag
Public Enum
std.Build.abi.ToClientTag
pubconstToClientTag = enum(u8)
All WebSocket messages sent by the server to the client begin with a ToClientTag byte. This enum is non-exhaustive only to avoid Illegal Behavior when malformed messages are sent over the socket; unnamed tags are an error condition and should terminate the connection.
Every tag has a curresponding extern struct representing the full message (or a header of the message if it is variable-length). For instance, .hello corresponds to Hello.
When introducing a tag, make sure to add a corresponding extern struct whose first field is this enum, and check its layout in the comptime block above.
All WebSocket messages sent by the server to the client begin with a
ToClientTagbyte. This enum is non-exhaustive only to avoid Illegal Behavior when malformed messages are sent over the socket; unnamed tags are an error condition and should terminate the connection.Every tag has a curresponding
extern structrepresenting the full message (or a header of the message if it is variable-length). For instance,.hellocorresponds toHello.When introducing a tag, make sure to add a corresponding
extern structwhose first field is this enum, andcheckits layout in thecomptimeblock above.