@@ -25,8 +25,8 @@ fn main() -> Result<(), Box<dyn Error>> {
25
25
let db = env. create_poly_database ( Some ( "kikou" ) ) ?;
26
26
27
27
let mut wtxn = env. write_txn ( ) ?;
28
- db. put :: < _ , OwnedType < [ i32 ; 2 ] > , Str > ( & mut wtxn, & [ 2 , 3 ] , "what's up?" ) ?;
29
- let ret = db. get :: < _ , OwnedType < [ i32 ; 2 ] > , Str > ( & wtxn, & [ 2 , 3 ] ) ?;
28
+ db. put :: < OwnedType < [ i32 ; 2 ] > , Str > ( & mut wtxn, & [ 2 , 3 ] , "what's up?" ) ?;
29
+ let ret = db. get :: < OwnedType < [ i32 ; 2 ] > , Str > ( & wtxn, & [ 2 , 3 ] ) ?;
30
30
31
31
println ! ( "{:?}" , ret) ;
32
32
wtxn. commit ( ) ?;
@@ -35,8 +35,8 @@ fn main() -> Result<(), Box<dyn Error>> {
35
35
let db = env. create_poly_database ( Some ( "kiki" ) ) ?;
36
36
37
37
let mut wtxn = env. write_txn ( ) ?;
38
- db. put :: < _ , Str , ByteSlice > ( & mut wtxn, "hello" , & [ 2 , 3 ] [ ..] ) ?;
39
- let ret = db. get :: < _ , Str , ByteSlice > ( & wtxn, "hello" ) ?;
38
+ db. put :: < Str , ByteSlice > ( & mut wtxn, "hello" , & [ 2 , 3 ] [ ..] ) ?;
39
+ let ret = db. get :: < Str , ByteSlice > ( & wtxn, "hello" ) ?;
40
40
41
41
println ! ( "{:?}" , ret) ;
42
42
wtxn. commit ( ) ?;
@@ -52,15 +52,15 @@ fn main() -> Result<(), Box<dyn Error>> {
52
52
let mut wtxn = env. write_txn ( ) ?;
53
53
54
54
let hello = Hello { string : "hi" } ;
55
- db. put :: < _ , Str , SerdeBincode < Hello > > ( & mut wtxn, "hello" , & hello) ?;
55
+ db. put :: < Str , SerdeBincode < Hello > > ( & mut wtxn, "hello" , & hello) ?;
56
56
57
- let ret = db. get :: < _ , Str , SerdeBincode < Hello > > ( & wtxn, "hello" ) ?;
57
+ let ret = db. get :: < Str , SerdeBincode < Hello > > ( & wtxn, "hello" ) ?;
58
58
println ! ( "serde-bincode:\t {:?}" , ret) ;
59
59
60
60
let hello = Hello { string : "hi" } ;
61
- db. put :: < _ , Str , SerdeJson < Hello > > ( & mut wtxn, "hello" , & hello) ?;
61
+ db. put :: < Str , SerdeJson < Hello > > ( & mut wtxn, "hello" , & hello) ?;
62
62
63
- let ret = db. get :: < _ , Str , SerdeJson < Hello > > ( & wtxn, "hello" ) ?;
63
+ let ret = db. get :: < Str , SerdeJson < Hello > > ( & wtxn, "hello" ) ?;
64
64
println ! ( "serde-json:\t {:?}" , ret) ;
65
65
66
66
wtxn. commit ( ) ?;
@@ -76,9 +76,9 @@ fn main() -> Result<(), Box<dyn Error>> {
76
76
let mut wtxn = env. write_txn ( ) ?;
77
77
78
78
let zerobytes = ZeroBytes { bytes : [ 24 ; 12 ] } ;
79
- db. put :: < _ , Str , UnalignedType < ZeroBytes > > ( & mut wtxn, "zero" , & zerobytes) ?;
79
+ db. put :: < Str , UnalignedType < ZeroBytes > > ( & mut wtxn, "zero" , & zerobytes) ?;
80
80
81
- let ret = db. get :: < _ , Str , UnalignedType < ZeroBytes > > ( & wtxn, "zero" ) ?;
81
+ let ret = db. get :: < Str , UnalignedType < ZeroBytes > > ( & wtxn, "zero" ) ?;
82
82
83
83
println ! ( "{:?}" , ret) ;
84
84
wtxn. commit ( ) ?;
@@ -87,12 +87,12 @@ fn main() -> Result<(), Box<dyn Error>> {
87
87
let db = env. create_poly_database ( Some ( "ignored-data" ) ) ?;
88
88
89
89
let mut wtxn = env. write_txn ( ) ?;
90
- db. put :: < _ , Str , Unit > ( & mut wtxn, "hello" , & ( ) ) ?;
91
- let ret = db. get :: < _ , Str , Unit > ( & wtxn, "hello" ) ?;
90
+ db. put :: < Str , Unit > ( & mut wtxn, "hello" , & ( ) ) ?;
91
+ let ret = db. get :: < Str , Unit > ( & wtxn, "hello" ) ?;
92
92
93
93
println ! ( "{:?}" , ret) ;
94
94
95
- let ret = db. get :: < _ , Str , Unit > ( & wtxn, "non-existant" ) ?;
95
+ let ret = db. get :: < Str , Unit > ( & wtxn, "non-existant" ) ?;
96
96
97
97
println ! ( "{:?}" , ret) ;
98
98
wtxn. commit ( ) ?;
@@ -117,27 +117,27 @@ fn main() -> Result<(), Box<dyn Error>> {
117
117
let db = env. create_poly_database ( Some ( "big-endian-iter" ) ) ?;
118
118
119
119
let mut wtxn = env. write_txn ( ) ?;
120
- db. put :: < _ , OwnedType < BEI64 > , Unit > ( & mut wtxn, & BEI64 :: new ( 0 ) , & ( ) ) ?;
121
- db. put :: < _ , OwnedType < BEI64 > , Unit > ( & mut wtxn, & BEI64 :: new ( 68 ) , & ( ) ) ?;
122
- db. put :: < _ , OwnedType < BEI64 > , Unit > ( & mut wtxn, & BEI64 :: new ( 35 ) , & ( ) ) ?;
123
- db. put :: < _ , OwnedType < BEI64 > , Unit > ( & mut wtxn, & BEI64 :: new ( 42 ) , & ( ) ) ?;
120
+ db. put :: < OwnedType < BEI64 > , Unit > ( & mut wtxn, & BEI64 :: new ( 0 ) , & ( ) ) ?;
121
+ db. put :: < OwnedType < BEI64 > , Unit > ( & mut wtxn, & BEI64 :: new ( 68 ) , & ( ) ) ?;
122
+ db. put :: < OwnedType < BEI64 > , Unit > ( & mut wtxn, & BEI64 :: new ( 35 ) , & ( ) ) ?;
123
+ db. put :: < OwnedType < BEI64 > , Unit > ( & mut wtxn, & BEI64 :: new ( 42 ) , & ( ) ) ?;
124
124
125
- let rets: Result < Vec < ( BEI64 , _ ) > , _ > = db. iter :: < _ , OwnedType < BEI64 > , Unit > ( & wtxn) ?. collect ( ) ;
125
+ let rets: Result < Vec < ( BEI64 , _ ) > , _ > = db. iter :: < OwnedType < BEI64 > , Unit > ( & wtxn) ?. collect ( ) ;
126
126
127
127
println ! ( "{:?}" , rets) ;
128
128
129
129
// or iterate over ranges too!!!
130
130
let range = BEI64 :: new ( 35 ) ..=BEI64 :: new ( 42 ) ;
131
131
let rets: Result < Vec < ( BEI64 , _ ) > , _ > =
132
- db. range :: < _ , OwnedType < BEI64 > , Unit , _ > ( & wtxn, & range) ?. collect ( ) ;
132
+ db. range :: < OwnedType < BEI64 > , Unit , _ > ( & wtxn, & range) ?. collect ( ) ;
133
133
134
134
println ! ( "{:?}" , rets) ;
135
135
136
136
// delete a range of key
137
137
let range = BEI64 :: new ( 35 ) ..=BEI64 :: new ( 42 ) ;
138
- let deleted: usize = db. delete_range :: < _ , OwnedType < BEI64 > , _ > ( & mut wtxn, & range) ?;
138
+ let deleted: usize = db. delete_range :: < OwnedType < BEI64 > , _ > ( & mut wtxn, & range) ?;
139
139
140
- let rets: Result < Vec < ( BEI64 , _ ) > , _ > = db. iter :: < _ , OwnedType < BEI64 > , Unit > ( & wtxn) ?. collect ( ) ;
140
+ let rets: Result < Vec < ( BEI64 , _ ) > , _ > = db. iter :: < OwnedType < BEI64 > , Unit > ( & wtxn) ?. collect ( ) ;
141
141
142
142
println ! ( "deleted: {:?}, {:?}" , deleted, rets) ;
143
143
wtxn. commit ( ) ?;
0 commit comments