Function field [src]

Serialize a field. Equivalent to calling fieldPrefix followed by value.

Prototype

pub fn field( self: *Struct, name: []const u8, val: anytype, options: ValueOptions, ) Error!void

Parameters

self: *Structname: []const u8options: ValueOptions

Possible Errors

WriteFailed Error

See the Writer implementation for detailed diagnostics.

Source

pub fn field( self: *Struct, name: []const u8, val: anytype, options: ValueOptions, ) Error!void { try self.container.field(name, val, options); }