pub fn parse(text: []const u8) ParseError!Uri text: []const u8UnexpectedCharacterInvalidFormatInvalidPortInvalidHostName352
353
354
355
356
357
358pub 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);
}
The return value will contain strings pointing into the original
text. Each component that is provided will be non-null.