@@ -2,6 +2,7 @@ use crate::any::value::AnyValueKind;
2
2
use crate :: any:: { Any , AnyTypeInfoKind } ;
3
3
use crate :: arguments:: Arguments ;
4
4
use crate :: encode:: { Encode , IsNull } ;
5
+ use crate :: encode_owned:: IntoEncode ;
5
6
use crate :: error:: BoxDynError ;
6
7
use crate :: types:: Type ;
7
8
use std:: sync:: Arc ;
@@ -21,9 +22,9 @@ impl Arguments for AnyArguments {
21
22
22
23
fn add < ' t , T > ( & mut self , value : T ) -> Result < ( ) , BoxDynError >
23
24
where
24
- T : Encode < ' t , Self :: Database > + Type < Self :: Database > ,
25
+ T : IntoEncode < Self :: Database > + Type < Self :: Database > ,
25
26
{
26
- let _: IsNull = value. encode ( & mut self . values ) ?;
27
+ let _: IsNull = value. into_encode ( ) . encode ( & mut self . values ) ?;
27
28
Ok ( ( ) )
28
29
}
29
30
@@ -37,26 +38,28 @@ pub struct AnyArgumentBuffer(#[doc(hidden)] pub Vec<AnyValueKind>);
37
38
38
39
impl AnyArguments {
39
40
#[ doc( hidden) ]
40
- pub fn convert_into < ' a , A : Arguments > ( self ) -> Result < A , BoxDynError >
41
+ pub fn convert_into < A : Arguments > ( self ) -> Result < A , BoxDynError >
41
42
where
42
- Option < i32 > : Type < A :: Database > + Encode < ' a , A :: Database > ,
43
- Option < bool > : Type < A :: Database > + Encode < ' a , A :: Database > ,
44
- Option < i16 > : Type < A :: Database > + Encode < ' a , A :: Database > ,
45
- Option < i32 > : Type < A :: Database > + Encode < ' a , A :: Database > ,
46
- Option < i64 > : Type < A :: Database > + Encode < ' a , A :: Database > ,
47
- Option < f32 > : Type < A :: Database > + Encode < ' a , A :: Database > ,
48
- Option < f64 > : Type < A :: Database > + Encode < ' a , A :: Database > ,
49
- Option < String > : Type < A :: Database > + Encode < ' a , A :: Database > ,
50
- Option < Vec < u8 > > : Type < A :: Database > + Encode < ' a , A :: Database > ,
51
- bool : Type < A :: Database > + Encode < ' a , A :: Database > ,
52
- i16 : Type < A :: Database > + Encode < ' a , A :: Database > ,
53
- i32 : Type < A :: Database > + Encode < ' a , A :: Database > ,
54
- i64 : Type < A :: Database > + Encode < ' a , A :: Database > ,
55
- f32 : Type < A :: Database > + Encode < ' a , A :: Database > ,
56
- f64 : Type < A :: Database > + Encode < ' a , A :: Database > ,
57
- Arc < String > : Type < A :: Database > + Encode < ' a , A :: Database > ,
58
- Arc < str > : Type < A :: Database > + Encode < ' a , A :: Database > ,
59
- Arc < Vec < u8 > > : Type < A :: Database > + Encode < ' a , A :: Database > ,
43
+ Option < i32 > : IntoEncode < A :: Database > + Type < A :: Database > ,
44
+ Option < bool > : IntoEncode < A :: Database > + Type < A :: Database > ,
45
+ Option < i16 > : IntoEncode < A :: Database > + Type < A :: Database > ,
46
+ Option < i32 > : IntoEncode < A :: Database > + Type < A :: Database > ,
47
+ Option < i64 > : IntoEncode < A :: Database > + Type < A :: Database > ,
48
+ Option < f32 > : IntoEncode < A :: Database > + Type < A :: Database > ,
49
+ Option < f64 > : IntoEncode < A :: Database > + Type < A :: Database > ,
50
+ Option < String > : IntoEncode < A :: Database > + Type < A :: Database > ,
51
+ Option < Vec < u8 > > : IntoEncode < A :: Database > + Type < A :: Database > ,
52
+ bool : IntoEncode < A :: Database > + Type < A :: Database > ,
53
+ i16 : IntoEncode < A :: Database > + Type < A :: Database > ,
54
+ i32 : IntoEncode < A :: Database > + Type < A :: Database > ,
55
+ i64 : IntoEncode < A :: Database > + Type < A :: Database > ,
56
+ f32 : IntoEncode < A :: Database > + Type < A :: Database > ,
57
+ f64 : IntoEncode < A :: Database > + Type < A :: Database > ,
58
+ String : IntoEncode < A :: Database > + Type < A :: Database > ,
59
+ Vec < u8 > : IntoEncode < A :: Database > + Type < A :: Database > ,
60
+ Arc < String > : IntoEncode < A :: Database > + Type < A :: Database > ,
61
+ Arc < str > : IntoEncode < A :: Database > + Type < A :: Database > ,
62
+ Arc < Vec < u8 > > : IntoEncode < A :: Database > + Type < A :: Database > ,
60
63
{
61
64
let mut out = A :: default ( ) ;
62
65
0 commit comments