Function getHost [src]
Returned value may point into buffer or be the original string.
Suggested buffer length: host_name_max.
See also:
getHostAlloc
Prototype
pub fn getHost(uri: Uri, buffer: []u8) error{ UriMissingHost, UriHostTooLong }![]const u8
Parameters
uri: Uri
buffer: []u8
Possible Errors
Source
pub fn getHost(uri: Uri, buffer: []u8) error{ UriMissingHost, UriHostTooLong }![]const u8 {
const component = uri.host orelse return error.UriMissingHost;
return component.toRaw(buffer) catch |err| switch (err) {
error.NoSpaceLeft => return error.UriHostTooLong,
};
}