Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Structs Uri

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
module 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;
}

Documentation

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.

Functions

Name Description
mustReconstruct
reconstruct

Reconstructs the URI from the data it points to, and validates that the reconstructed URI matches the original URI.

Variables

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