MCPcopy Create free account
hub / github.com/argumentcomputer/ix / capped_capacity

Function capped_capacity

crates/ixon/src/serialize.rs:33–35  ·  view source on GitHub ↗
(count: u64, buf: &[u8])

Source from the content-addressed store, hash-verified

31/// Each item requires at least 1 byte, so capacity can never exceed buffer length.
32#[inline]
33fn capped_capacity(count: u64, buf: &[u8]) -> usize {
34 (count as usize).min(buf.len())
35}
36
37fn put_u8(x: u8, buf: &mut Vec<u8>) {
38 buf.push(x);

Callers 5

get_exprFunction · 0.85
get_sharingFunction · 0.85
getMethod · 0.85
get_refsFunction · 0.85
get_univsFunction · 0.85

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected