pub trait SerdeHash: Sized + FromStr + Display + Index<usize, Output = u8, Output = [u8]> + Index<RangeFull>
where Self::Err: Display,
{ const N: usize; // Required method fn from_slice_delegated(sl: &[u8]) -> Result<Self, FromSliceError>; // Provided methods fn serialize<S>( &self, s: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where S: Serializer { ... } fn deserialize<'de, D>( d: D ) -> Result<Self, <D as Deserializer<'de>>::Error> where D: Deserializer<'de> { ... } }
Expand description

Default serialization/deserialization methods.

Required Associated Constants§

const N: usize

Size, in bits, of the hash.

Required Methods§

fn from_slice_delegated(sl: &[u8]) -> Result<Self, FromSliceError>

Helper function to turn a deserialized slice into the correct hash type.

Provided Methods§

fn serialize<S>( &self, s: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Do serde serialization.

fn deserialize<'de, D>(d: D) -> Result<Self, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Do serde deserialization.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl SerdeHash for Hash

§

const N: usize = 32usize

§

fn from_slice_delegated(sl: &[u8]) -> Result<Hash, FromSliceError>

Implementors§

source§

impl SerdeHash for DescriptorId

source§

const N: usize = 32usize

§

impl SerdeHash for BlockHash

§

const N: usize = 32usize

§

impl SerdeHash for FilterHash

§

const N: usize = 32usize

§

impl SerdeHash for FilterHeader

§

const N: usize = 32usize

§

impl SerdeHash for LegacySighash

§

const N: usize = 32usize

§

impl SerdeHash for PubkeyHash

§

const N: usize = 20usize

§

impl SerdeHash for ScriptHash

§

const N: usize = 20usize

§

impl SerdeHash for SegwitV0Sighash

§

const N: usize = 32usize

§

impl SerdeHash for TapLeafHash

§

const N: usize = 32usize

§

impl SerdeHash for TapNodeHash

§

const N: usize = 32usize

§

impl SerdeHash for TapSighash

§

const N: usize = 32usize

§

impl SerdeHash for TapTweakHash

§

const N: usize = 32usize

§

impl SerdeHash for TxMerkleNode

§

const N: usize = 32usize

§

impl SerdeHash for Txid

§

const N: usize = 32usize

§

impl SerdeHash for WPubkeyHash

§

const N: usize = 20usize

§

impl SerdeHash for WScriptHash

§

const N: usize = 32usize

§

impl SerdeHash for WitnessCommitment

§

const N: usize = 32usize

§

impl SerdeHash for WitnessMerkleNode

§

const N: usize = 32usize

§

impl SerdeHash for Wtxid

§

const N: usize = 32usize

§

impl SerdeHash for XKeyIdentifier

§

const N: usize = 20usize

§

impl SerdeHash for bdk_chain::bitcoin::hashes::hash160::Hash

§

const N: usize = 20usize

§

impl SerdeHash for bdk_chain::bitcoin::hashes::ripemd160::Hash

§

const N: usize = 20usize

§

impl SerdeHash for bdk_chain::bitcoin::hashes::sha1::Hash

§

const N: usize = 20usize

§

impl SerdeHash for bdk_chain::bitcoin::hashes::sha256::Hash

§

const N: usize = 32usize

§

impl SerdeHash for Midstate

§

const N: usize = 32usize

§

impl SerdeHash for bdk_chain::bitcoin::hashes::sha256d::Hash

§

const N: usize = 32usize

§

impl SerdeHash for bdk_chain::bitcoin::hashes::sha384::Hash

§

const N: usize = 48usize

§

impl SerdeHash for bdk_chain::bitcoin::hashes::sha512::Hash

§

const N: usize = 64usize

§

impl SerdeHash for bdk_chain::bitcoin::hashes::sha512_256::Hash

§

const N: usize = 32usize

§

impl SerdeHash for bdk_chain::bitcoin::hashes::siphash24::Hash

§

const N: usize = 8usize

§

impl<T> SerdeHash for bdk_chain::bitcoin::hashes::sha256t::Hash<T>
where T: Tag,

§

const N: usize = 32usize