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 Http1BodyChunk

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
module juptune.http.v1;

struct Http1BodyChunk
{
    /++ ALIASES ++/
    
    ///
    alias __xdtor = __MARMOS_BUG__;
    
    /++ FUNCTIONS ++/
    
    /// Accesses the body chunk data. 
    void access(void function(ubyte[] data) func);
    /// ditto. 
    void access(void function(ubyte[] data) func);
    /// Determines if there's more data left to read from the body. 
    bool hasDataLeft();
    ///
    Http1BodyChunk opAssign(Http1BodyChunk p);
    
    /++ VARIABLES ++/
    
    ///
    Http1PinnedSlice entireChunk;
}

Documentation

Contains the contents of a body chunk.

Notes

This struct contains a pinned slice of the Http1Reader's buffer, so after processing the body chunk, the user code must release the slice by destroying the struct (e.g. setting it to .init, letting it go out of scope, etc.)

In order to make it as clear as possible that data from this struct must not** be escaped, the accessmethod is provided which enforces via the type system that string data is not escaped.

You are not provided an entire chunk at once, but rather a slice of the chunk which is determined by either the size of the buffer, the size of the chunk, or the size of the data received by the incoming TCP packet.

Aliases

Name Description
__xdtor

Functions

Name Description
access

Accesses the body chunk data.

access

ditto.

hasDataLeft

Determines if there's more data left to read from the body.

opAssign

Variables

Name Description
entireChunk