Back to Site
Loading...
Searching...
No Matches
librats::framer::Block Struct Reference

#include <frame.h>

Public Types

enum  Status { Ok , Incomplete , Error }
 

Public Attributes

enum librats::framer::Block::Status status = Incomplete
 
size_t consumed = 0
 bytes to consume from the buffer (when Ok)
 
ByteView body {}
 the block body (when Ok); views the input
 
size_t needed = 0
 Total size of this block on the wire (prefix + body), known as soon as the prefix has been read; 0 while the prefix itself is still incomplete.
 

Detailed Description

Definition at line 79 of file frame.h.

Member Enumeration Documentation

◆ Status

Enumerator
Ok 
Incomplete 
Error 

Definition at line 80 of file frame.h.

Member Data Documentation

◆ body

ByteView librats::framer::Block::body {}

the block body (when Ok); views the input

Definition at line 82 of file frame.h.

◆ consumed

size_t librats::framer::Block::consumed = 0

bytes to consume from the buffer (when Ok)

Definition at line 81 of file frame.h.

◆ needed

size_t librats::framer::Block::needed = 0

Total size of this block on the wire (prefix + body), known as soon as the prefix has been read; 0 while the prefix itself is still incomplete.

On an Incomplete block this is what the receive path needs before it can parse, so it can size the buffer for the whole block in one allocation instead of climbing to it 1.5x at a time.

Definition at line 89 of file frame.h.

◆ status

enum librats::framer::Block::Status librats::framer::Block::status = Incomplete

The documentation for this struct was generated from the following file: