ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
pc_span Struct Reference

A writable byte region: the storage, the capacity that belongs to it, and what has been produced into it. More...

#include <span.h>

Public Attributes

uint8_t * buf
 first byte, or nullptr when the region could not be obtained
 
size_t cap
 bytes writable at buf (0 whenever buf is nullptr)
 
size_t pos
 bytes the payload needs so far; keeps counting past cap on overflow
 
bool overflow
 set once a write did not fit; pos then reports the size required
 

Detailed Description

A writable byte region: the storage, the capacity that belongs to it, and what has been produced into it.

Field names match the bytes.h write-cursor convention on purpose - see the file comment.

Definition at line 64 of file span.h.

Member Data Documentation

◆ buf

◆ cap

size_t pc_span::cap

bytes writable at buf (0 whenever buf is nullptr)

Definition at line 67 of file span.h.

Referenced by pc_span_after(), pc_span_first(), pc_span_from(), pc_span_read(), pc_span_room(), and pc_ssh_server_dispatch().

◆ pos

size_t pc_span::pos

bytes the payload needs so far; keeps counting past cap on overflow

Definition at line 68 of file span.h.

Referenced by pc_span_from(), pc_span_len(), pc_span_produced(), pc_span_reset(), and pc_span_room().

◆ overflow

bool pc_span::overflow

set once a write did not fit; pos then reports the size required

Definition at line 69 of file span.h.

Referenced by pc_span_from(), pc_span_ok(), and pc_span_reset().


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