pub fn sapling_spends_per_anchor(
        &self,
    ) -> Box<dyn Iterator<Item = sapling::Spend<sapling::PerSpendAnchor>> + '_> {
        match self {
            Transaction::V4 {
                sapling_shielded_data: Some(sapling_shielded_data),
                ..
            } => Box::new(sapling_shielded_data.spends_per_anchor()),
            Transaction::V5 {
                sapling_shielded_data: Some(sapling_shielded_data),
                ..
            } => Box::new(sapling_shielded_data.spends_per_anchor()),

            // No Spends
            Transaction::V1 { .. }
            | Transaction::V2 { .. }
            | Transaction::V3 { .. }
            | Transaction::V4 {
                sapling_shielded_data: None,
                ..
            }
            | Transaction::V5 {
                sapling_shielded_data: None,
                ..
            } => Box::new(std::iter::empty()),
        }
    }
/// Iterate over the sapling [`Spend`](sapling::Spend)s for this transaction,
/// returning `Spend<PerSpendAnchor>` regardless of the underlying
/// transaction version.
///
/// Shared anchors in V5 transactions are copied into each sapling spend.
/// This allows the same code to validate spends from V4 and V5 transactions.
///
/// # Correctness
///
/// Do not use this function for serialization.
Iterate over the sapling [`Spend`](sapling::Spend)s for this transaction,
returning `Spend` regardless of the underlying
transaction version.

Shared anchors in V5 transactions are copied into each sapling spend.
This allows the same code to validate spends from V4 and V5 transactions.
Iterate over the sapling [ ` Spend ` ] ( sapling :: Spend ) s for this transaction returning ` Spend ` regardless of the underlying transaction version . Shared anchors in V5 transactions are copied into each sapling spend . This allows the same code to validate spends from V4 and V5 transactions .
pub fn sapling_spends_per_anchor(
        &self,
    ) -> Box<dyn Iterator<Item = sapling::Spend<sapling::PerSpendAnchor>> + '_> {
        match self {
            Transaction::V4 {
                sapling_shielded_data: Some(sapling_shielded_data),
                ..
            } => Box::new(sapling_shielded_data.spends_per_anchor()),
            Transaction::V5 {
                sapling_shielded_data: Some(sapling_shielded_data),
                ..
            } => Box::new(sapling_shielded_data.spends_per_anchor()),
            // No Spends
            Transaction::V1 { .. }
            | Transaction::V2 { .. }
            | Transaction::V3 { .. }
            | Transaction::V4 {
                sapling_shielded_data: None,
                ..
            }
            | Transaction::V5 {
                sapling_shielded_data: None,
                ..
            } => Box::new(std::iter::empty()),
        }
    }
pub fn sapling_spends_per_anchor ( & self , ) -> Box < dyn Iterator < Item = sapling :: Spend < sapling :: PerSpendAnchor > > + ' _ > { match self { Transaction :: V4 { sapling_shielded_data : Some ( sapling_shielded_data ) , .. } => Box :: new ( sapling_shielded_data . spends_per_anchor ( ) ) , Transaction :: V5 { sapling_shielded_data : Some ( sapling_shielded_data ) , .. } => Box :: new ( sapling_shielded_data . spends_per_anchor ( ) ) , // No Spends Transaction :: V1 { .. } | Transaction :: V2 { .. } | Transaction :: V3 { .. } | Transaction :: V4 { sapling_shielded_data : None , .. } | Transaction :: V5 { sapling_shielded_data : None , .. } => Box :: new ( std :: iter :: empty ( ) ) , } }
Iterate over the sapling [`Spend`](sapling::Spend)s for this transaction,
returning `Spend<PerSpendAnchor>` regardless of the underlying
transaction version.
Iterate over the sapling [ ` Spend ` ] ( sapling :: Spend ) s for this transaction returning ` Spend<PerSpendAnchor > ` regardless of the underlying transaction version .
&self
correctness
Do not use this function for serialization.
Do not use this function for serialization .