Crate array_bytes
source ·Expand description
A collection of array/bytes/hex utilities.
Completely optimized for blockchain development. Especially the Substrate.
Enums§
- The main error of array-bytes.
Traits§
- Convert the given type to hex.
- Try to convert the given hex to a specific type.
Functions§
AsRef<[u8]>
toString
.- Just like
hex2bytes
but to a fixed length array. - Just like
hex2array
but without the checking. AsRef<[u8]>
toVec<u8>
.- Just like
hex2bytes
but without checking. AsRef<[u8]>
to&[u8]
.- Just like
hex2slice
but without checking. - Convert hex bytes to hex string.
- Just like
hex_bytes2hex_str
but without the checking. - Try to convert
AsRef<[u8]>
toT
directly, whereT: From<Vec<u8>>
. - Just like
hex_into
but without the checking. - Try to convert
AsRef<[u8]>
toT
directly, whereT: From<[u8; N]>
. - Just like
hex_n_into
but without the checking. - Prefixes the given element to the given array/slice/vector to make it a fixed-size array of length
N
. &[T]
to[T; N]
.&[T]
to&[T; N]
.- Just like
slice2array_ref
but without the checking. - Just like
slice2array
but without the checking. - Convert
&[T]
to a type directly. - Just like
slice_n_into
but without the checking. - Suffixes the given element to the given array/slice/vector to make it a fixed-size array of length
N
. Vec<T>
to[T; N]
.- Just like
vec2array
but without the checking. - Convert
Vec<T>
to a type directly. - Just like
vec_n_into
but without the checking.
Type Aliases§
- The main result of array-bytes.