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.

parse

The return value will contain strings pointing into the original text. Each component that is provided will be non-null.

Uri.parse
pub fn parse(text: []const u8) ParseError!Uri

File

lib/std/Uri.zig:352

Code

pub fn parse(text: []const u8) ParseError!Uri {
    const scheme, const rest = std.mem.cutScalar(u8, text, ':') orelse
        return error.InvalidFormat;
    if (!isValidScheme(scheme))
        return error.UnexpectedCharacter;
    return parseAfterScheme(scheme, rest);
}