Skip to main content

setup_varint

Function setup_varint 

Source
pub fn setup_varint(value: &KvpValue) -> Option<u64>
Expand description

Read a varint out of a setup parameter value, whichever shape it arrived in.

This draft frames every setup parameter as {Type, Length, Value}, and the decoder has no per-key table telling it which values are numbers, so a parameter that came off the wire always arrives as bytes. A caller that matches on KvpValue::Varint alone therefore never sees anything a peer sent - only something this process built itself. Both shapes are read here, and a value with bytes left over after the varint is refused rather than truncated.