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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl SerdeHash for BlockHash

§

const N: usize = 32usize

§

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

§

impl SerdeHash for ContractHash

§

const N: usize = 32usize

§

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

§

impl SerdeHash for Elip151Hash

§

const N: usize = 32usize

§

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

§

impl SerdeHash for Hash

§

const N: usize = 32usize

§

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

§

impl SerdeHash for Hash

§

const N: usize = 32usize

§

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

§

impl SerdeHash for PubkeyHash

§

const N: usize = 20usize

§

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

§

impl SerdeHash for ScriptHash

§

const N: usize = 20usize

§

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

§

impl SerdeHash for Sighash

§

const N: usize = 32usize

§

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

§

impl SerdeHash for TapLeafHash

§

const N: usize = 32usize

§

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

§

impl SerdeHash for TapNodeHash

§

const N: usize = 32usize

§

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

§

impl SerdeHash for TapSighashHash

§

const N: usize = 32usize

§

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

§

impl SerdeHash for TapTweakHash

§

const N: usize = 32usize

§

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

§

impl SerdeHash for TapTweakHash

§

const N: usize = 32usize

§

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

§

impl SerdeHash for TxMerkleNode

§

const N: usize = 32usize

§

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

§

impl SerdeHash for Txid

§

const N: usize = 32usize

§

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

§

impl SerdeHash for WPubkeyHash

§

const N: usize = 20usize

§

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

§

impl SerdeHash for WScriptHash

§

const N: usize = 32usize

§

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

§

impl SerdeHash for Wtxid

§

const N: usize = 32usize

§

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

Implementors§

§

impl SerdeHash for breez_sdk_liquid::lightning_125::bitcoin::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 breez_sdk_liquid::lightning_125::bitcoin::PubkeyHash

§

const N: usize = 20usize

§

impl SerdeHash for breez_sdk_liquid::lightning_125::bitcoin::ScriptHash

§

const N: usize = 20usize

§

impl SerdeHash for SegwitV0Sighash

§

const N: usize = 32usize

§

impl SerdeHash for breez_sdk_liquid::lightning_125::bitcoin::TapLeafHash

§

const N: usize = 32usize

§

impl SerdeHash for breez_sdk_liquid::lightning_125::bitcoin::TapNodeHash

§

const N: usize = 32usize

§

impl SerdeHash for TapSighash

§

const N: usize = 32usize

§

impl SerdeHash for breez_sdk_liquid::lightning_125::bitcoin::TapTweakHash

§

const N: usize = 32usize

§

impl SerdeHash for breez_sdk_liquid::lightning_125::bitcoin::TxMerkleNode

§

const N: usize = 32usize

§

impl SerdeHash for breez_sdk_liquid::lightning_125::bitcoin::Txid

§

const N: usize = 32usize

§

impl SerdeHash for breez_sdk_liquid::lightning_125::bitcoin::WPubkeyHash

§

const N: usize = 20usize

§

impl SerdeHash for breez_sdk_liquid::lightning_125::bitcoin::WScriptHash

§

const N: usize = 32usize

§

impl SerdeHash for WitnessCommitment

§

const N: usize = 32usize

§

impl SerdeHash for WitnessMerkleNode

§

const N: usize = 32usize

§

impl SerdeHash for breez_sdk_liquid::lightning_125::bitcoin::Wtxid

§

const N: usize = 32usize

§

impl SerdeHash for XKeyIdentifier

§

const N: usize = 20usize

§

impl SerdeHash for breez_sdk_liquid::lightning_125::bitcoin::hashes::hash160::Hash

§

const N: usize = 20usize

§

impl SerdeHash for breez_sdk_liquid::lightning_125::bitcoin::hashes::ripemd160::Hash

§

const N: usize = 20usize

§

impl SerdeHash for breez_sdk_liquid::lightning_125::bitcoin::hashes::sha1::Hash

§

const N: usize = 20usize

§

impl SerdeHash for breez_sdk_liquid::lightning_125::bitcoin::hashes::sha256::Hash

§

const N: usize = 32usize

§

impl SerdeHash for Midstate

§

const N: usize = 32usize

§

impl SerdeHash for breez_sdk_liquid::lightning_125::bitcoin::hashes::sha256d::Hash

§

const N: usize = 32usize

§

impl SerdeHash for breez_sdk_liquid::lightning_125::bitcoin::hashes::sha384::Hash

§

const N: usize = 48usize

§

impl SerdeHash for breez_sdk_liquid::lightning_125::bitcoin::hashes::sha512::Hash

§

const N: usize = 64usize

§

impl SerdeHash for breez_sdk_liquid::lightning_125::bitcoin::hashes::sha512_256::Hash

§

const N: usize = 32usize

§

impl SerdeHash for breez_sdk_liquid::lightning_125::bitcoin::hashes::siphash24::Hash

§

const N: usize = 8usize

§

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

§

const N: usize = 32usize