@@ -9,18 +9,18 @@ use std::collections::HashMap;
9
9
use std:: error:: Error as StdError ;
10
10
use std:: sync:: { Arc , Weak } ;
11
11
12
- use proto:: bind:: BindFuture ;
13
- use proto:: connection:: { Request , RequestMessages } ;
14
- use proto:: copy_in:: { CopyInFuture , CopyInReceiver , CopyMessage } ;
15
- use proto:: copy_out:: CopyOutStream ;
16
- use proto:: execute:: ExecuteFuture ;
17
- use proto:: portal:: Portal ;
18
- use proto:: prepare:: PrepareFuture ;
19
- use proto:: query:: QueryStream ;
20
- use proto:: simple_query:: SimpleQueryFuture ;
21
- use proto:: statement:: Statement ;
22
- use types:: { IsNull , Oid , ToSql , Type } ;
23
- use Error ;
12
+ use crate :: proto:: bind:: BindFuture ;
13
+ use crate :: proto:: connection:: { Request , RequestMessages } ;
14
+ use crate :: proto:: copy_in:: { CopyInFuture , CopyInReceiver , CopyMessage } ;
15
+ use crate :: proto:: copy_out:: CopyOutStream ;
16
+ use crate :: proto:: execute:: ExecuteFuture ;
17
+ use crate :: proto:: portal:: Portal ;
18
+ use crate :: proto:: prepare:: PrepareFuture ;
19
+ use crate :: proto:: query:: QueryStream ;
20
+ use crate :: proto:: simple_query:: SimpleQueryFuture ;
21
+ use crate :: proto:: statement:: Statement ;
22
+ use crate :: types:: { IsNull , Oid , ToSql , Type } ;
23
+ use crate :: Error ;
24
24
25
25
pub struct PendingRequest ( Result < RequestMessages , Error > ) ;
26
26
@@ -127,23 +127,23 @@ impl Client {
127
127
PrepareFuture :: new ( self . clone ( ) , pending, name)
128
128
}
129
129
130
- pub fn execute ( & self , statement : & Statement , params : & [ & ToSql ] ) -> ExecuteFuture {
130
+ pub fn execute ( & self , statement : & Statement , params : & [ & dyn ToSql ] ) -> ExecuteFuture {
131
131
let pending = PendingRequest (
132
132
self . excecute_message ( statement, params)
133
133
. map ( RequestMessages :: Single ) ,
134
134
) ;
135
135
ExecuteFuture :: new ( self . clone ( ) , pending, statement. clone ( ) )
136
136
}
137
137
138
- pub fn query ( & self , statement : & Statement , params : & [ & ToSql ] ) -> QueryStream < Statement > {
138
+ pub fn query ( & self , statement : & Statement , params : & [ & dyn ToSql ] ) -> QueryStream < Statement > {
139
139
let pending = PendingRequest (
140
140
self . excecute_message ( statement, params)
141
141
. map ( RequestMessages :: Single ) ,
142
142
) ;
143
143
QueryStream :: new ( self . clone ( ) , pending, statement. clone ( ) )
144
144
}
145
145
146
- pub fn bind ( & self , statement : & Statement , name : String , params : & [ & ToSql ] ) -> BindFuture {
146
+ pub fn bind ( & self , statement : & Statement , name : String , params : & [ & dyn ToSql ] ) -> BindFuture {
147
147
let mut buf = self . bind_message ( statement, & name, params) ;
148
148
if let Ok ( ref mut buf) = buf {
149
149
frontend:: sync ( buf) ;
@@ -161,12 +161,12 @@ impl Client {
161
161
QueryStream :: new ( self . clone ( ) , pending, portal. clone ( ) )
162
162
}
163
163
164
- pub fn copy_in < S > ( & self , statement : & Statement , params : & [ & ToSql ] , stream : S ) -> CopyInFuture < S >
164
+ pub fn copy_in < S > ( & self , statement : & Statement , params : & [ & dyn ToSql ] , stream : S ) -> CopyInFuture < S >
165
165
where
166
166
S : Stream ,
167
167
S :: Item : IntoBuf ,
168
168
<S :: Item as IntoBuf >:: Buf : Send ,
169
- S :: Error : Into < Box < StdError + Sync + Send > > ,
169
+ S :: Error : Into < Box < dyn StdError + Sync + Send > > ,
170
170
{
171
171
let ( mut sender, receiver) = mpsc:: channel ( 0 ) ;
172
172
let pending = PendingRequest ( self . excecute_message ( statement, params) . map ( |buf| {
@@ -182,7 +182,7 @@ impl Client {
182
182
CopyInFuture :: new ( self . clone ( ) , pending, statement. clone ( ) , stream, sender)
183
183
}
184
184
185
- pub fn copy_out ( & self , statement : & Statement , params : & [ & ToSql ] ) -> CopyOutStream {
185
+ pub fn copy_out ( & self , statement : & Statement , params : & [ & dyn ToSql ] ) -> CopyOutStream {
186
186
let pending = PendingRequest (
187
187
self . excecute_message ( statement, params)
188
188
. map ( RequestMessages :: Single ) ,
@@ -213,7 +213,7 @@ impl Client {
213
213
& self ,
214
214
statement : & Statement ,
215
215
name : & str ,
216
- params : & [ & ToSql ] ,
216
+ params : & [ & dyn ToSql ] ,
217
217
) -> Result < Vec < u8 > , Error > {
218
218
let mut buf = vec ! [ ] ;
219
219
let r = frontend:: bind (
@@ -236,7 +236,7 @@ impl Client {
236
236
}
237
237
}
238
238
239
- fn excecute_message ( & self , statement : & Statement , params : & [ & ToSql ] ) -> Result < Vec < u8 > , Error > {
239
+ fn excecute_message ( & self , statement : & Statement , params : & [ & dyn ToSql ] ) -> Result < Vec < u8 > , Error > {
240
240
let mut buf = self . bind_message ( statement, "" , params) ?;
241
241
frontend:: execute ( "" , 0 , & mut buf) . map_err ( Error :: parse) ?;
242
242
frontend:: sync ( & mut buf) ;
0 commit comments