@@ -19,7 +19,7 @@ pub use bulk_write::*;
19
19
20
20
/// The result of a [`Collection::insert_one`](../struct.Collection.html#method.insert_one)
21
21
/// operation.
22
- #[ derive( Clone , Debug , Serialize ) ]
22
+ #[ derive( Clone , Debug , Serialize , Default ) ]
23
23
#[ serde( rename_all = "camelCase" ) ]
24
24
#[ non_exhaustive]
25
25
pub struct InsertOneResult {
@@ -37,26 +37,18 @@ impl InsertOneResult {
37
37
38
38
/// The result of a [`Collection::insert_many`](../struct.Collection.html#method.insert_many)
39
39
/// operation.
40
- #[ derive( Debug , Serialize ) ]
40
+ #[ derive( Debug , Serialize , Default ) ]
41
41
#[ serde( rename_all = "camelCase" ) ]
42
42
#[ non_exhaustive]
43
43
pub struct InsertManyResult {
44
44
/// The `_id` field of the documents inserted.
45
45
pub inserted_ids : HashMap < usize , Bson > ,
46
46
}
47
47
48
- impl InsertManyResult {
49
- pub ( crate ) fn new ( ) -> Self {
50
- InsertManyResult {
51
- inserted_ids : HashMap :: new ( ) ,
52
- }
53
- }
54
- }
55
-
56
48
/// The result of a [`Collection::update_one`](../struct.Collection.html#method.update_one) or
57
49
/// [`Collection::update_many`](../struct.Collection.html#method.update_many) operation.
58
50
#[ skip_serializing_none]
59
- #[ derive( Clone , Debug , Serialize ) ]
51
+ #[ derive( Clone , Debug , Serialize , Default ) ]
60
52
#[ serde( rename_all = "camelCase" ) ]
61
53
#[ non_exhaustive]
62
54
pub struct UpdateResult {
@@ -74,7 +66,7 @@ pub struct UpdateResult {
74
66
75
67
/// The result of a [`Collection::delete_one`](../struct.Collection.html#method.delete_one) or
76
68
/// [`Collection::delete_many`](../struct.Collection.html#method.delete_many) operation.
77
- #[ derive( Clone , Debug , Serialize ) ]
69
+ #[ derive( Clone , Debug , Serialize , Default ) ]
78
70
#[ serde( rename_all = "camelCase" ) ]
79
71
#[ non_exhaustive]
80
72
pub struct DeleteResult {
@@ -85,7 +77,7 @@ pub struct DeleteResult {
85
77
86
78
/// Information about the index created as a result of a
87
79
/// [`Collection::create_index`](../struct.Collection.html#method.create_index).
88
- #[ derive( Debug , Clone , PartialEq ) ]
80
+ #[ derive( Debug , Clone , PartialEq , Default ) ]
89
81
#[ non_exhaustive]
90
82
pub struct CreateIndexResult {
91
83
/// The name of the index created in the `createIndex` command.
@@ -94,7 +86,7 @@ pub struct CreateIndexResult {
94
86
95
87
/// Information about the indexes created as a result of a
96
88
/// [`Collection::create_indexes`](../struct.Collection.html#method.create_indexes).
97
- #[ derive( Debug , Clone , PartialEq ) ]
89
+ #[ derive( Debug , Clone , PartialEq , Default ) ]
98
90
#[ non_exhaustive]
99
91
pub struct CreateIndexesResult {
100
92
/// The list containing the names of all indexes created in the `createIndexes` command.
@@ -120,14 +112,15 @@ pub(crate) struct GetMoreResult {
120
112
121
113
/// Describes the type of data store returned when executing
122
114
/// [`Database::list_collections`](../struct.Database.html#method.list_collections).
123
- #[ derive( Debug , Clone , Serialize , Deserialize , PartialEq ) ]
115
+ #[ derive( Debug , Clone , Serialize , Deserialize , PartialEq , Default ) ]
124
116
#[ serde( rename_all = "camelCase" ) ]
125
117
#[ non_exhaustive]
126
118
pub enum CollectionType {
127
119
/// Indicates that the data store is a view.
128
120
View ,
129
121
130
122
/// Indicates that the data store is a collection.
123
+ #[ default]
131
124
Collection ,
132
125
133
126
/// Indicates that the data store is a timeseries.
@@ -140,7 +133,7 @@ pub enum CollectionType {
140
133
///
141
134
/// See the MongoDB [manual](https://www.mongodb.com/docs/manual/reference/command/listCollections/#listCollections.cursor)
142
135
/// for more information.
143
- #[ derive( Debug , Clone , Deserialize , Serialize ) ]
136
+ #[ derive( Debug , Clone , Deserialize , Serialize , Default ) ]
144
137
#[ serde( rename_all = "camelCase" ) ]
145
138
#[ non_exhaustive]
146
139
pub struct CollectionSpecificationInfo {
@@ -155,7 +148,7 @@ pub struct CollectionSpecificationInfo {
155
148
156
149
/// Information about a collection as reported by
157
150
/// [`Database::list_collections`](../struct.Database.html#method.list_collections).
158
- #[ derive( Debug , Clone , Deserialize , Serialize ) ]
151
+ #[ derive( Debug , Clone , Deserialize , Serialize , Default ) ]
159
152
#[ serde( rename_all = "camelCase" ) ]
160
153
#[ non_exhaustive]
161
154
pub struct CollectionSpecification {
@@ -179,7 +172,7 @@ pub struct CollectionSpecification {
179
172
180
173
/// A struct modeling the information about an individual database returned from
181
174
/// [`Client::list_databases`](../struct.Client.html#method.list_databases).
182
- #[ derive( Debug , Clone , Deserialize , Serialize , PartialEq ) ]
175
+ #[ derive( Debug , Clone , Deserialize , Serialize , PartialEq , Default ) ]
183
176
#[ serde( rename_all = "camelCase" ) ]
184
177
#[ non_exhaustive]
185
178
pub struct DatabaseSpecification {
0 commit comments