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 › tables › boot_services › BootServices › locateHandle Public Function locateHandle Doc Source 717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736 pub fn locateHandle (
self : *BootServices ,
search : LocateSearch ,
buffer : []Handle ,
) LocateHandleError ![]Handle {
var len : usize = @sizeOf (Handle ) * buffer .len ;
switch (self ._locateHandle (
std .meta .activeTag (search ),
if (search == .by_protocol ) search .by_protocol else null ,
if (search == .by_register_notify ) search .by_register_notify else null ,
&len ,
buffer .ptr ,
)) {
.success => return buffer [0 ..@divExact (len , @sizeOf (Handle ))],
.not_found => return buffer [0 ..0 ],
.buffer_too_small => return error .BufferTooSmall ,
.invalid_parameter => return error .InvalidParameter ,
else => |status | return uefi .unexpectedStatus (status ),
}
}
To determine the necessary size of
buffer, calllocateHandleLenfirst.