@@ -107,9 +107,10 @@ pub trait I2c<A: AddressMode = SevenBitAddress>: ErrorType {
107
107
) -> Self :: WriteReadFuture < ' a > ;
108
108
109
109
/// Future returned by the `transaction` method.
110
- type TransactionFuture < ' a > : Future < Output = Result < ( ) , Self :: Error > > + ' a
110
+ type TransactionFuture < ' a , ' b > : Future < Output = Result < ( ) , Self :: Error > > + ' a
111
111
where
112
- Self : ' a ;
112
+ Self : ' a ,
113
+ ' b : ' a ;
113
114
114
115
/// Execute the provided operations on the I2C bus as a single transaction.
115
116
///
@@ -124,11 +125,11 @@ pub trait I2c<A: AddressMode = SevenBitAddress>: ErrorType {
124
125
/// - `SAD+R/W` = slave address followed by bit 1 to indicate reading or 0 to indicate writing
125
126
/// - `SR` = repeated start condition
126
127
/// - `SP` = stop condition
127
- fn transaction < ' a > (
128
+ fn transaction < ' a , ' b > (
128
129
& ' a mut self ,
129
130
address : A ,
130
- operations : & mut [ Operation < ' a > ] ,
131
- ) -> Self :: TransactionFuture < ' a > ;
131
+ operations : & ' a mut [ Operation < ' b > ] ,
132
+ ) -> Self :: TransactionFuture < ' a , ' b > ;
132
133
}
133
134
134
135
impl < A : AddressMode , T : I2c < A > > I2c < A > for & mut T {
@@ -164,16 +165,17 @@ impl<A: AddressMode, T: I2c<A>> I2c<A> for &mut T {
164
165
T :: write_read ( self , address, bytes, buffer)
165
166
}
166
167
167
- type TransactionFuture < ' a >
168
+ type TransactionFuture < ' a , ' b >
168
169
where
169
170
Self : ' a ,
170
- = T :: TransactionFuture < ' a > ;
171
+ ' b : ' a ,
172
+ = T :: TransactionFuture < ' a , ' b > ;
171
173
172
- fn transaction < ' a > (
174
+ fn transaction < ' a , ' b > (
173
175
& ' a mut self ,
174
176
address : A ,
175
- operations : & mut [ Operation < ' a > ] ,
176
- ) -> Self :: TransactionFuture < ' a > {
177
+ operations : & ' a mut [ Operation < ' b > ] ,
178
+ ) -> Self :: TransactionFuture < ' a , ' b > {
177
179
T :: transaction ( self , address, operations)
178
180
}
179
181
}
0 commit comments