@@ -2,6 +2,7 @@ use std::borrow::Cow;
22use std:: rc:: Rc ;
33use std:: sync:: Arc ;
44
5+ use crate :: arguments:: SqliteArgumentsBuffer ;
56use crate :: decode:: Decode ;
67use crate :: encode:: { Encode , IsNull } ;
78use crate :: error:: BoxDynError ;
@@ -20,7 +21,7 @@ impl Type<Sqlite> for [u8] {
2021}
2122
2223impl Encode < ' _ , Sqlite > for & ' _ [ u8 ] {
23- fn encode_by_ref ( & self , args : & mut Vec < SqliteArgumentValue > ) -> Result < IsNull , BoxDynError > {
24+ fn encode_by_ref ( & self , args : & mut SqliteArgumentsBuffer ) -> Result < IsNull , BoxDynError > {
2425 args. push ( SqliteArgumentValue :: Blob ( self . to_vec ( ) ) ) ;
2526
2627 Ok ( IsNull :: No )
@@ -34,13 +35,13 @@ impl<'r> Decode<'r, Sqlite> for &'r [u8] {
3435}
3536
3637impl Encode < ' _ , Sqlite > for Box < [ u8 ] > {
37- fn encode ( self , args : & mut Vec < SqliteArgumentValue > ) -> Result < IsNull , BoxDynError > {
38+ fn encode ( self , args : & mut SqliteArgumentsBuffer ) -> Result < IsNull , BoxDynError > {
3839 args. push ( SqliteArgumentValue :: Blob ( self . into_vec ( ) ) ) ;
3940
4041 Ok ( IsNull :: No )
4142 }
4243
43- fn encode_by_ref ( & self , args : & mut Vec < SqliteArgumentValue > ) -> Result < IsNull , BoxDynError > {
44+ fn encode_by_ref ( & self , args : & mut SqliteArgumentsBuffer ) -> Result < IsNull , BoxDynError > {
4445 args. push ( SqliteArgumentValue :: Blob ( self . clone ( ) . into_vec ( ) ) ) ;
4546
4647 Ok ( IsNull :: No )
@@ -58,13 +59,13 @@ impl Type<Sqlite> for Vec<u8> {
5859}
5960
6061impl Encode < ' _ , Sqlite > for Vec < u8 > {
61- fn encode ( self , args : & mut Vec < SqliteArgumentValue > ) -> Result < IsNull , BoxDynError > {
62+ fn encode ( self , args : & mut SqliteArgumentsBuffer ) -> Result < IsNull , BoxDynError > {
6263 args. push ( SqliteArgumentValue :: Blob ( self ) ) ;
6364
6465 Ok ( IsNull :: No )
6566 }
6667
67- fn encode_by_ref ( & self , args : & mut Vec < SqliteArgumentValue > ) -> Result < IsNull , BoxDynError > {
68+ fn encode_by_ref ( & self , args : & mut SqliteArgumentsBuffer ) -> Result < IsNull , BoxDynError > {
6869 args. push ( SqliteArgumentValue :: Blob ( self . clone ( ) ) ) ;
6970
7071 Ok ( IsNull :: No )
@@ -78,27 +79,27 @@ impl<'r> Decode<'r, Sqlite> for Vec<u8> {
7879}
7980
8081impl Encode < ' _ , Sqlite > for Cow < ' _ , [ u8 ] > {
81- fn encode ( self , args : & mut Vec < SqliteArgumentValue > ) -> Result < IsNull , BoxDynError > {
82+ fn encode ( self , args : & mut SqliteArgumentsBuffer ) -> Result < IsNull , BoxDynError > {
8283 args. push ( SqliteArgumentValue :: Blob ( self . to_vec ( ) ) ) ;
8384
8485 Ok ( IsNull :: No )
8586 }
8687
87- fn encode_by_ref ( & self , args : & mut Vec < SqliteArgumentValue > ) -> Result < IsNull , BoxDynError > {
88+ fn encode_by_ref ( & self , args : & mut SqliteArgumentsBuffer ) -> Result < IsNull , BoxDynError > {
8889 args. push ( SqliteArgumentValue :: Blob ( self . to_vec ( ) ) ) ;
8990
9091 Ok ( IsNull :: No )
9192 }
9293}
9394
9495impl Encode < ' _ , Sqlite > for Arc < [ u8 ] > {
95- fn encode_by_ref ( & self , args : & mut Vec < SqliteArgumentValue > ) -> Result < IsNull , BoxDynError > {
96+ fn encode_by_ref ( & self , args : & mut SqliteArgumentsBuffer ) -> Result < IsNull , BoxDynError > {
9697 <Vec < u8 > as Encode < ' _ , Sqlite > >:: encode ( self . to_vec ( ) , args)
9798 }
9899}
99100
100101impl Encode < ' _ , Sqlite > for Rc < [ u8 ] > {
101- fn encode_by_ref ( & self , args : & mut Vec < SqliteArgumentValue > ) -> Result < IsNull , BoxDynError > {
102+ fn encode_by_ref ( & self , args : & mut SqliteArgumentsBuffer ) -> Result < IsNull , BoxDynError > {
102103 <Vec < u8 > as Encode < ' _ , Sqlite > >:: encode ( self . to_vec ( ) , args)
103104 }
104105}
0 commit comments