Some(outpoint)
}
+ /// Drain and iterate over [`ScriptBuf`]s with corresponding [`Txid`] histories contained in
+ /// this request, consuming them.
+ pub fn drain_spks_with_expected_txids(
+ &mut self,
+ ) -> impl ExactSizeIterator<Item = SpkWithExpectedTxids> + '_ {
+ SyncIter::<I, D, SpkWithExpectedTxids>::new(self)
+ }
+
/// Iterate over [`ScriptBuf`]s with corresponding [`Txid`] histories contained in this request.
+ #[deprecated(
+ note = "use `drain_spks_with_expected_txids` for consuming iteration or `spks` for read-only iteration"
+ )]
pub fn iter_spks_with_expected_txids(
&mut self,
) -> impl ExactSizeIterator<Item = SpkWithExpectedTxids> + '_ {
- SyncIter::<I, D, SpkWithExpectedTxids>::new(self)
+ self.drain_spks_with_expected_txids()
+ }
+
+ /// Drain and iterate over [`Txid`]s contained in this request, consuming them.
+ pub fn drain_txids(&mut self) -> impl ExactSizeIterator<Item = Txid> + '_ {
+ SyncIter::<I, D, Txid>::new(self)
+ }
+
+ /// Drain and iterate over [`OutPoint`]s contained in this request, consuming them.
+ pub fn drain_outpoints(&mut self) -> impl ExactSizeIterator<Item = OutPoint> + '_ {
+ SyncIter::<I, D, OutPoint>::new(self)
}
/// Iterate over [`Txid`]s contained in this request.
+ #[deprecated(
+ note = "use `drain_txids` for consuming iteration or `txids` for read-only iteration"
+ )]
pub fn iter_txids(&mut self) -> impl ExactSizeIterator<Item = Txid> + '_ {
- SyncIter::<I, D, Txid>::new(self)
+ self.drain_txids()
}
/// Iterate over [`OutPoint`]s contained in this request.
+ #[deprecated(
+ note = "use `drain_outpoints` for consuming iteration or `outpoints` for read-only iteration"
+ )]
pub fn iter_outpoints(&mut self) -> impl ExactSizeIterator<Item = OutPoint> + '_ {
- SyncIter::<I, D, OutPoint>::new(self)
+ self.drain_outpoints()
+ }
+
+ /// Iterate over script pubkeys (with indexes) contained in this request, without
+ /// consuming them.
+ pub fn spks(&self) -> impl ExactSizeIterator<Item = &(I, ScriptBuf)> + '_ {
+ self.spks.iter()
+ }
+
+ /// Iterate over [`Txid`]s contained in this request, without consuming them.
+ pub fn txids(&self) -> impl ExactSizeIterator<Item = &Txid> + '_ {
+ self.txids.iter()
+ }
+
+ /// Iterate over [`OutPoint`]s contained in this request, without consuming them.
+ pub fn outpoints(&self) -> impl ExactSizeIterator<Item = &OutPoint> + '_ {
+ self.outpoints.iter()
}
fn _call_inspect(&mut self, item: SyncItem<I>) {
start_time,
&mut tx_update,
request
- .iter_spks_with_expected_txids()
+ .drain_spks_with_expected_txids()
.enumerate()
.map(|(i, spk)| (i as u32, spk)),
usize::MAX,
self.populate_with_txids(
start_time,
&mut tx_update,
- request.iter_txids(),
+ request.drain_txids(),
&mut pending_anchors,
)?;
self.populate_with_outpoints(
start_time,
&mut tx_update,
- request.iter_outpoints(),
+ request.drain_outpoints(),
&mut pending_anchors,
)?;