Merge bitcoindevkit/bdk#2236: feat(core): add non-consuming SyncRequest iterators
b3a3087823a51c2dc2e87ae6fc29716a7e5c5028 feat(core): split SyncRequest consuming and read-only iterators (Alok)
Pull request description:
### Description
`SyncRequest`'s `iter_*` methods drain the request despite their names, and there is no way to inspect pending items without consuming them. This PR, as proposed in #2220:
- Adds read-only `spks()`, `txids()` and `outpoints()`.
- Adds consuming `drain_spks_with_expected_txids()`, `drain_txids()` and `drain_outpoints()`.
- Deprecates `iter_spks_with_expected_txids()`, `iter_txids()` and `iter_outpoints()` as wrappers around the `drain_*` methods, so existing callers keep working.
- Moves the electrum and esplora call sites to `drain_*`.
No new tests: the behaviour is evident from the signatures.
Fixes #2220
### Changelog notice
### Added
- `SyncRequest::spks`, `SyncRequest::txids` and `SyncRequest::outpoints` for read-only access to pending sync items.
- `SyncRequest::drain_spks_with_expected_txids`, `SyncRequest::drain_txids` and `SyncRequest::drain_outpoints` for consuming iteration.
### Deprecated
- `SyncRequest::iter_spks_with_expected_txids`, `SyncRequest::iter_txids` and `SyncRequest::iter_outpoints`; use the `drain_*` methods, or the read-only accessors.
### Checklists
**All Submissions**
- [x] I followed the contribution guidelines.
**New Features**
- [ ] I've added tests for the new feature.
- [x] I've added docs for the new feature.
ACKs for top commit:
evanlinjin:
ACK
b3a3087823a51c2dc2e87ae6fc29716a7e5c5028
Tree-SHA512: afb94312fe4adf42beb344a3885c1d799a5d3ba866f1ab11c653da88b597d86af069b322781dc09c453fb59253c2c63fb4da8f214038815862ea24fb3f94e774