MCPcopy Create free account
hub / github.com/SoftbearStudios/bitcode / unpack_bytes

Function unpack_bytes

src/pack.rs:144–150  ·  view source on GitHub ↗

Opposite of `pack_bytes`. Needs to know the `length` in bytes. `out` is overwritten with the bytes.

(
    input: &mut &'a [u8],
    length: usize,
    out: &mut CowSlice<'a, T>,
)

Source from the content-addressed store, hash-verified

142
143/// Opposite of `pack_bytes`. Needs to know the `length` in bytes. `out` is overwritten with the bytes.
144pub fn unpack_bytes<'a, T: Byte>(
145 input: &mut &'a [u8],
146 length: usize,
147 out: &mut CowSlice<'a, T>,
148) -> Result<()> {
149 unpack_bytes_unsigned(input, length, out.cast_mut())
150}
151
152/// [`unpack_bytes`] but after i8s have been cast to u8s.
153fn unpack_bytes_unsigned<'a>(

Callers 5

test_pack_bytes_u8Function · 0.85
test_pack_bytes_i8Function · 0.85
populateMethod · 0.85
unpack8Method · 0.85
populateMethod · 0.85

Calls 3

unpack_bytes_unsignedFunction · 0.85
cast_mutMethod · 0.80
as_sliceMethod · 0.80

Tested by 2

test_pack_bytes_u8Function · 0.68
test_pack_bytes_i8Function · 0.68