Module conv

Source
Expand description

Zero-cost conversion functions for valence_nbt.

While working with Value, it is often necessary to convert between collections of signed and unsigned integer types due to API differences. For instance, you may be given a &[i8] from Value::ByteArray, but functions like Write::write_all expect to receive a &[u8].

This module provides functions to perform conversions between these types with zero-cost and no unsafe code on your part.

Functions§

i8_slice_as_u8_slice
Converts a &[i8] into a &[u8].
i8_vec_into_u8_vec
Converts a Vec<i8> into a Vec<u8> without cloning.
u8_slice_as_i8_slice
Converts a &[u8] into a &[i8].
u8_vec_into_i8_vec
Converts a Vec<u8> into a Vec<i8> without cloning.