@@ -5,35 +5,32 @@ pub trait Read<W> {
5
5
/// Error type
6
6
type Error ;
7
7
8
- /// Reads enough bytes from the slave to fill `left_words` and `right_words`.
9
- fn try_read < ' w > (
10
- & mut self ,
11
- left_words : & ' w mut [ W ] ,
12
- right_words : & ' w mut [ W ] ,
13
- ) -> Result < ( ) , Self :: Error > ;
8
+ /// Reads enough bytes from the slave to fill `data`.
9
+ ///
10
+ /// The data is filled up with interleaved data as appropriate.
11
+ fn try_read < ' w > ( & mut self , data : & ' w mut [ W ] ) -> Result < ( ) , Self :: Error > ;
14
12
}
15
13
16
14
/// Blocking write
17
15
pub trait Write < W > {
18
16
/// Error type
19
17
type Error ;
20
18
21
- /// Sends `left_words` and `right_words` to the slave.
22
- fn try_write < ' w > (
23
- & mut self ,
24
- left_words : & ' w [ W ] ,
25
- right_words : & ' w [ W ] ,
26
- ) -> Result < ( ) , Self :: Error > ;
19
+ /// Sends `data` to the slave.
20
+ ///
21
+ /// The data should be filled with interleaved data as appropriate.
22
+ fn try_write < ' w > ( & mut self , data : & ' w [ W ] ) -> Result < ( ) , Self :: Error > ;
27
23
}
28
24
29
25
/// Blocking write (iterator version)
30
26
pub trait WriteIter < W > {
31
27
/// Error type
32
28
type Error ;
33
29
34
- /// Sends `left_words` and `right_words` to the slave.
35
- fn try_write < LW , RW > ( & mut self , left_words : LW , right_words : RW ) -> Result < ( ) , Self :: Error >
30
+ /// Sends `data` to the slave.
31
+ ///
32
+ /// The data should be filled with interleaved data as appropriate.
33
+ fn try_write < I > ( & mut self , data : I ) -> Result < ( ) , Self :: Error >
36
34
where
37
- LW : IntoIterator < Item = W > ,
38
- RW : IntoIterator < Item = W > ;
35
+ I : IntoIterator < Item = W > ;
39
36
}
0 commit comments