@@ -38,7 +38,7 @@ pub trait ElectrumApi {
38
38
/// Takes a list of `txids` and returns a list of transactions.
39
39
fn batch_transaction_get < ' t , I > ( & self , txids : I ) -> Result < Vec < Transaction > , Error >
40
40
where
41
- I : IntoIterator < Item = & ' t Txid > ,
41
+ I : IntoIterator < Item = & ' t Txid > + Clone ,
42
42
{
43
43
self . batch_transaction_get_raw ( txids) ?
44
44
. iter ( )
@@ -49,9 +49,9 @@ pub trait ElectrumApi {
49
49
/// Batch version of [`block_header`](#method.block_header).
50
50
///
51
51
/// Takes a list of `heights` of blocks and returns a list of headers.
52
- fn batch_block_header < ' s , I > ( & self , heights : I ) -> Result < Vec < BlockHeader > , Error >
52
+ fn batch_block_header < I > ( & self , heights : I ) -> Result < Vec < BlockHeader > , Error >
53
53
where
54
- I : IntoIterator < Item = u32 > ,
54
+ I : IntoIterator < Item = u32 > + Clone ,
55
55
{
56
56
self . batch_block_header_raw ( heights) ?
57
57
. iter ( )
@@ -68,7 +68,7 @@ pub trait ElectrumApi {
68
68
/// Execute a queue of calls stored in a [`Batch`](../batch/struct.Batch.html) struct. Returns
69
69
/// `Ok()` **only if** all of the calls are successful. The order of the JSON `Value`s returned
70
70
/// reflects the order in which the calls were made on the `Batch` struct.
71
- fn batch_call ( & self , batch : Batch ) -> Result < Vec < serde_json:: Value > , Error > ;
71
+ fn batch_call ( & self , batch : & Batch ) -> Result < Vec < serde_json:: Value > , Error > ;
72
72
73
73
/// Subscribes to notifications for new block headers, by sending a `blockchain.headers.subscribe` call and
74
74
/// returns the current tip as raw bytes instead of deserializing them.
@@ -118,7 +118,7 @@ pub trait ElectrumApi {
118
118
/// Takes a list of scripts and returns a list of balance responses.
119
119
fn batch_script_get_balance < ' s , I > ( & self , scripts : I ) -> Result < Vec < GetBalanceRes > , Error >
120
120
where
121
- I : IntoIterator < Item = & ' s Script > ;
121
+ I : IntoIterator < Item = & ' s Script > + Clone ;
122
122
123
123
/// Returns the history for a *scriptPubKey*
124
124
fn script_get_history ( & self , script : & Script ) -> Result < Vec < GetHistoryRes > , Error > ;
@@ -128,7 +128,7 @@ pub trait ElectrumApi {
128
128
/// Takes a list of scripts and returns a list of history responses.
129
129
fn batch_script_get_history < ' s , I > ( & self , scripts : I ) -> Result < Vec < Vec < GetHistoryRes > > , Error >
130
130
where
131
- I : IntoIterator < Item = & ' s Script > ;
131
+ I : IntoIterator < Item = & ' s Script > + Clone ;
132
132
133
133
/// Returns the list of unspent outputs for a *scriptPubKey*
134
134
fn script_list_unspent ( & self , script : & Script ) -> Result < Vec < ListUnspentRes > , Error > ;
@@ -141,7 +141,7 @@ pub trait ElectrumApi {
141
141
scripts : I ,
142
142
) -> Result < Vec < Vec < ListUnspentRes > > , Error >
143
143
where
144
- I : IntoIterator < Item = & ' s Script > ;
144
+ I : IntoIterator < Item = & ' s Script > + Clone ;
145
145
146
146
/// Gets the raw bytes of a transaction with `txid`. Returns an error if not found.
147
147
fn transaction_get_raw ( & self , txid : & Txid ) -> Result < Vec < u8 > , Error > ;
@@ -151,22 +151,22 @@ pub trait ElectrumApi {
151
151
/// Takes a list of `txids` and returns a list of transactions raw bytes.
152
152
fn batch_transaction_get_raw < ' t , I > ( & self , txids : I ) -> Result < Vec < Vec < u8 > > , Error >
153
153
where
154
- I : IntoIterator < Item = & ' t Txid > ;
154
+ I : IntoIterator < Item = & ' t Txid > + Clone ;
155
155
156
156
/// Batch version of [`block_header_raw`](#method.block_header_raw).
157
157
///
158
158
/// Takes a list of `heights` of blocks and returns a list of block header raw bytes.
159
- fn batch_block_header_raw < ' s , I > ( & self , heights : I ) -> Result < Vec < Vec < u8 > > , Error >
159
+ fn batch_block_header_raw < I > ( & self , heights : I ) -> Result < Vec < Vec < u8 > > , Error >
160
160
where
161
- I : IntoIterator < Item = u32 > ;
161
+ I : IntoIterator < Item = u32 > + Clone ;
162
162
163
163
/// Batch version of [`estimate_fee`](#method.estimate_fee).
164
164
///
165
165
/// Takes a list of `numbers` of blocks and returns a list of fee required in
166
166
/// **Satoshis per kilobyte** to confirm a transaction in the given number of blocks.
167
- fn batch_estimate_fee < ' s , I > ( & self , numbers : I ) -> Result < Vec < f64 > , Error >
167
+ fn batch_estimate_fee < I > ( & self , numbers : I ) -> Result < Vec < f64 > , Error >
168
168
where
169
- I : IntoIterator < Item = usize > ;
169
+ I : IntoIterator < Item = usize > + Clone ;
170
170
171
171
/// Broadcasts the raw bytes of a transaction to the network.
172
172
fn transaction_broadcast_raw ( & self , raw_tx : & [ u8 ] ) -> Result < Txid , Error > ;
0 commit comments