pub trait TryToBytes {
// Required method
fn to_bytes_vec(&self) -> StdResult<Vec<u8>>;
// Provided method
fn to_bytes_hex(&self) -> StdResult<String> { ... }
}
Expand description
Traits for serializing to bytes
Required Methods§
Sourcefn to_bytes_vec(&self) -> StdResult<Vec<u8>>
fn to_bytes_vec(&self) -> StdResult<Vec<u8>>
Try to convert to a bytes vector.
Provided Methods§
Sourcefn to_bytes_hex(&self) -> StdResult<String>
fn to_bytes_hex(&self) -> StdResult<String>
Try to convert to hex bytes representation