Trait bitcoin_hashes::serde_macros::serde_details::SerdeHash
source · pub trait SerdeHashwhere
Self: Sized + FromStr + Display + Index<usize, Output = u8> + Index<RangeFull, Output = [u8]>,
<Self as FromStr>::Err: Display,{
const N: usize;
// Required method
fn from_slice_delegated(sl: &[u8]) -> Result<Self, FromSliceError>;
// Provided methods
fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error> { ... }
fn deserialize<'de, D: Deserializer<'de>>(d: D) -> Result<Self, D::Error> { ... }
}
Expand description
Default serialization/deserialization methods.
Required Associated Constants§
Required Methods§
sourcefn from_slice_delegated(sl: &[u8]) -> Result<Self, FromSliceError>
fn from_slice_delegated(sl: &[u8]) -> Result<Self, FromSliceError>
Helper function to turn a deserialized slice into the correct hash type.
Provided Methods§
sourcefn deserialize<'de, D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<'de, D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Do serde deserialization.