DoxigAlpha

writeStruct

Function parameters

Parameters

#
value:anytype

Type definitions in this namespace

Types

#

Functions in this namespace

Functions

#
adaptToNewApi
Helper for bridging to the new `Writer` API while upgrading.

Source

Implementation

#
pub fn writeStruct(self: Self, value: anytype) anyerror!void {
    // Only extern and packed structs have defined in-memory layout.
    comptime assert(@typeInfo(@TypeOf(value)).@"struct".layout != .auto);
    return self.writeAll(mem.asBytes(&value));
}