Zig 0.17.0-dev (Split by item)
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 library itself.
Zig › std/ › zig/ › Server.zig › serveErrorBundle
serveErrorBundle
Server.serveErrorBundle
pub fn serveErrorBundle (s : *Server , error_bundle : std .zig .ErrorBundle ) !void
File
Code
pub fn serveErrorBundle (s : *Server , error_bundle : std .zig .ErrorBundle ) !void {
const eb_hdr : OutMessage .ErrorBundle = .{
.extra_len = @intCast (error_bundle .extra .len ),
.string_bytes_len = @intCast (error_bundle .string_bytes .len ),
};
const bytes_len = @sizeOf (OutMessage .ErrorBundle ) +
4 * error_bundle .extra .len + error_bundle .string_bytes .len ;
try s .serveMessageHeader (.{
.tag = .error_bundle ,
.bytes_len = @intCast (bytes_len ),
});
try s .out .writeStruct (eb_hdr , .little );
try s .out .writeSliceEndian (u32 , error_bundle .extra , .little );
try s .out .writeAll (error_bundle .string_bytes );
try s .out .flush ();
}