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. Public Function
pubfnlocateHandleLen(self: *constBootServices, search: LocateSearch) NumHandlesError!usize {
varlen: usize = 0;
switch (self._locateHandle(
std.meta.activeTag(search),
if (search == .by_protocol) search.by_protocolelsenull,
if (search == .by_register_notify) search.by_register_notifyelsenull,
&len,
null,
)) {
// If len is zero, it should return not_found, otherwise buffer_too_small.// This is because it can/should only return success when a valid buffer is// passed with a non zero size, which is not the case.// Thus this status is considered unreachable and will return error.Unexpected// .success => unreachable,
.buffer_too_small => return@divExact(len, @sizeOf(uefi.Handle)),
.not_found => return0,
// This function accounts for all possible causes of this error code// as per the most recent UEFI spec 2.10A, therefore this branch is// considered unreachable and will return error.Unexpected instead// .invalid_parameter => unreachableelse => |status| returnuefi.unexpectedStatus(status),
}
}
Returns the number of handles that match the given search criteria.