Expand description
A collection of array/bytes/hex utilities.
Completely optimized for blockchain development. Especially the Substrate.
Enums§
- Error
- The main error of array-bytes.
Traits§
- Hex
- Convert the given type to hex.
- TryFrom
Hex - Try to convert the given hex to a specific type.
Functions§
- bytes2hex
AsRef<[u8]>toString.- hex2array
- Just like
hex2bytesbut to a fixed length array. - hex2array_
unchecked - Just like
hex2arraybut without the checking. - hex2bytes
AsRef<[u8]>toVec<u8>.- hex2bytes_
unchecked - Just like
hex2bytesbut without checking. - hex2slice
AsRef<[u8]>to&[u8].- hex2slice_
unchecked - Just like
hex2slicebut without checking. - hex_
bytes2hex_ str - Convert hex bytes to hex string.
- hex_
bytes2hex_ ⚠str_ unchecked - Just like
hex_bytes2hex_strbut without the checking. - hex_
into - Try to convert
AsRef<[u8]>toTdirectly, whereT: From<Vec<u8>>. - hex_
into_ unchecked - Just like
hex_intobut without the checking. - hex_
n_ into - Try to convert
AsRef<[u8]>toTdirectly, whereT: From<[u8; N]>. - hex_
n_ into_ unchecked - Just like
hex_n_intobut without the checking. - prefix_
with - Prefixes the given element to the given array/slice/vector to make it a fixed-size array of
length
N. - slice2array
&[T]to[T; N].- slice2array_
ref &[T]to&[T; N].- slice2array_
ref_ unchecked - Just like
slice2array_refbut without the checking. - slice2array_
unchecked - Just like
slice2arraybut without the checking. - slice_
n_ into - Convert
&[T]to a type directly. - slice_
n_ into_ unchecked - Just like
slice_n_intobut without the checking. - suffix_
with - Suffixes the given element to the given array/slice/vector to make it a fixed-size array of
length
N. - vec2array
Vec<T>to[T; N].- vec2array_
unchecked - Just like
vec2arraybut without the checking. - vec_
n_ into - Convert
Vec<T>to a type directly. - vec_
n_ into_ unchecked - Just like
vec_n_intobut without the checking.
Type Aliases§
- Result
- The main result of array-bytes.