MCPcopy Index your code
hub / github.com/SoftbearStudios/bitcode / write

Method write

src/pack.rs:32–36  ·  view source on GitHub ↗
(self, out: &mut Vec<u8>, offset_by_min: bool)

Source from the content-addressed store, hash-verified

30 }
31
32 fn write(self, out: &mut Vec<u8>, offset_by_min: bool) {
33 // Encoded in such a way such that 0 is `Self::_256` and higher numbers are smaller packing.
34 // Also makes `Self::_256` with offset_by_min = true is unrepresentable.
35 out.push(self as u8 * 2 - offset_by_min as u8);
36 }
37
38 fn read(input: &mut &[u8]) -> Result<(Self, bool)> {
39 let v = consume_byte(input)?;

Callers 9

pack_bytes_unsignedFunction · 0.45
pack_arithmeticFunction · 0.45
unpack_arithmeticFunction · 0.45
decode_in_placeMethod · 0.45
collect_intoMethod · 0.45
decode_in_placeMethod · 0.45
decode_in_placeMethod · 0.45
decode_in_placeMethod · 0.45
decode_in_placeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected