Crate dusk_bytes

source ·
Expand description

Enums

  • Dusk Bytes operation error variants

Traits

  • 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.
  • 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.
  • 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.
  • 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.
  • Implementors of the Read trait are called ‘readers’.
  • The core trait used to implement [from_bytes] and [to_bytes]
  • Implementors of the Write trait are sometimes called ‘writers’.

Functions

  • 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