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

Functions Uri.reconstruct

1
2
3
4
5
6
7
8
9
10
11
12
module juptune.http.uri;

Result reconstruct(
    ArrayBase!(
        Malloc, 
        8LU, 
        (length, capacity) => max(capacity, length) * 2, 
        (length, capacity) => length < capacity / 2, 
        (length, capacity) => capacity / 2, 
        char
    ) result
);

Documentation

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

Notes

In debug builds the error returned will contain additional information about the mismatch.

If an error is thrown, the resultparameter will still contain the reconstructed URI, but it is up to the user whether to risk using it or not.

Params

Throws

Anything that uriParseNoCopycan throw.

UriError.noneif the reconstructed URI does not match the original URI.

Since this error is technically a programmer bug it doesn't have a dedicated error code.

Because URIs are heavily influenced by user input it was decided that this function should handle the error gracefully instead of asserting, just to prevent any potential denial of service.

Returns

A Resultindicating whether the reconstruction was successful or not.