1234567891011121314151617181920212223242526272829303132module juptune.http.uri;
struct Uri
{
/++ FUNCTIONS ++/
///
void mustReconstruct();
/// Reconstructs the URI from the data it points to, and validates that the reconstructed URI matches the original URI.
Result reconstruct(ArrayBase!(Malloc, 8LU, (length, capacity) => max(capacity, length) * 2, (length, capacity) => length < capacity / 2, (length, capacity) => capacity / 2, char) result);
/++ VARIABLES ++/
/// The fragment of the URI, e.g. "#some-fragment", if one exists
const char[] fragment;
/// A bitmask of hints that can be used to determine the structure of the URI
UriParseHints hints;
/// The host of the URI, e.g. "localhost", if one exists
const char[] host;
/// The host of the URI as an IP address, if one exists.
Nullable!(IpAddress) hostAsIp;
/// The path of the URI, e.g. "/some/path", if one exists
const char[] path;
/// The port of the URI, if one exists.
Nullable!(ushort) port;
/// The query of the URI, e.g. "?some=query", if one exists
const char[] query;
/// The scheme of the URI, e.g. "http", if one exists
const char[] scheme;
/// The user info of the URI, e.g. "user:info", if one exists
const char[] userInfo;
}
A fairly featureless POD struct that represents a URI that specifically does not own the data it points to.
This means this struct is only valid for as long as the data it points to is valid, but it has other interesting implications such as using data from multiple non-contigous memory blocks if suitable.
| Name | Description |
|---|---|
| mustReconstruct | |
| reconstruct |
Reconstructs the URI from the data it points to, and validates that the reconstructed URI matches the original URI. |
| Name | Description |
|---|---|
| fragment |
The fragment of the URI, e.g. "#some-fragment", if one exists |
| hints |
A bitmask of hints that can be used to determine the structure of the URI |
| host |
The host of the URI, e.g. "localhost", if one exists |
| hostAsIp |
The host of the URI as an IP address, if one exists. |
| path |
The path of the URI, e.g. "/some/path", if one exists |
| port |
The port of the URI, if one exists. |
| query |
The query of the URI, e.g. "?some=query", if one exists |
| scheme |
The scheme of the URI, e.g. "http", if one exists |
| userInfo |
The user info of the URI, e.g. "user:info", if one exists |