MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / empty_page_frame_overhead

Function empty_page_frame_overhead

libatomic/src/daemon/provenance_core.rs:174–182  ·  view source on GitHub ↗

The encoded size of one empty frozen-page response frame: the protobuf message plus the 5-byte gRPC length-prefix. The budget reserves this overhead before dividing, exactly like the legacy JSON frame budget.

()

Source from the content-addressed store, hash-verified

172/// message plus the 5-byte gRPC length-prefix. The budget reserves this
173/// overhead before dividing, exactly like the legacy JSON frame budget.
174fn empty_page_frame_overhead() -> usize {
175 let empty = crate::atomic::LoadFrozenEnvelopesResponse {
176 page: Some(crate::atomic::FrozenPage {
177 fragments: Vec::new(),
178 next: Some(crate::atomic::PageCursor::default()),
179 }),
180 };
181 empty.encode_to_vec().len() + 5
182}
183
184/// The legacy budget math: reserve the worst-case metadata and four
185/// payload bytes per budget byte, then clamp to the page size.

Callers 1

frozen_page_budgetFunction · 0.85

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected