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 standard library.
std › os › uefi › protocol › simple_network › SimpleNetwork › receive Public Function receive Doc Source Public Function std.os.uefi.protocol.simple_network.SimpleNetwork.receive
pub fn receive (self : *SimpleNetwork , buffer : []u8 ) ReceiveError !Packet Params File os/uefi/protocol/simple_network.zig: 328
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349 pub fn receive (self : *SimpleNetwork , buffer : []u8 ) ReceiveError !Packet {
var packet : Packet = undefined ;
packet .buffer = buffer ;
switch (self ._receive (
self ,
&packet .header_size ,
&packet .buffer .len ,
packet .buffer .ptr ,
&packet .src_addr ,
&packet .dst_addr ,
&packet .protocol ,
)) {
.success => return packet ,
.not_started => return error .NotStarted ,
.not_ready => return error .NotReady ,
.buffer_too_small => return error .BufferTooSmall ,
.invalid_parameter => return error .InvalidParameter ,
.device_error => return error .DeviceError ,
else => |status | return uefi .unexpectedStatus (status ),
}
}
Receives a packet from a network interface.