Crate dusk_bytes

Source
Expand description

Enums§

Error
Dusk Bytes operation error variants

Traits§

BadLength
Trait to be implemented for the associated Error used in [DeserializableSlice::from_slice]. The function is called if the slice given is smaller than the mandatory size for the struct.
DeserializableSlice
An optional trait used to implement [from_slice] on top of types that uses Serializable trait. The default implementation makes use of Serializable trait to provide the necessary deserialization functionality without additional code from the consumer.
InvalidChar
Trait to be implemented for the associated Error used in [ParseHexStr::from_hex_str]. The function is called if an invalid character is found in the string slice.
ParseHexStr
An optional trait used to parse a string slice for types that implements the Serializable trait. The default implementation makes use of Serializable trait to provide the necessary parsing functionality without additional code from the consumer.
Read
Implementors of the Read trait are called ‘readers’.
Serializable
The core trait used to implement [from_bytes] and [to_bytes]
Write
Implementors of the Write trait are sometimes called ‘writers’.

Functions§

hex
A constant funtion to parse a bytes string representing hexadecimals (e.g. b"fe12c6" ) into bytes (e.g [0xfe, 0x12, 0xc6]). If a smaller destination buffer is provided, the value will be truncated (e.g [0xfe, 0x12]); if a bigger destination buffer is provided, it will be padded with zeroes (e.g. `[0xfe, 0x12, 0xc6, 0x0, 0x0])

Derive Macros§

Hex
HexDebug