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

Function get_u8

crates/ixon/src/serialize.rs:41–49  ·  view source on GitHub ↗
(buf: &mut &[u8])

Source from the content-addressed store, hash-verified

39}
40
41fn get_u8(buf: &mut &[u8]) -> Result<u8, String> {
42 match buf.split_first() {
43 Some((&x, rest)) => {
44 *buf = rest;
45 Ok(x)
46 },
47 None => Err("get_u8: EOF".to_string()),
48 }
49}
50
51fn put_bool(x: bool, buf: &mut Vec<u8>) {
52 buf.push(if x { 1 } else { 0 });

Callers 6

get_boolFunction · 0.70
get_serMethod · 0.70
getMethod · 0.70
get_nameFunction · 0.70
get_name_componentFunction · 0.70
get_named_indexedFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected