@@ -19,7 +19,7 @@ pub use bulk_write::*;
1919
2020/// The result of a [`Collection::insert_one`](../struct.Collection.html#method.insert_one)
2121/// operation.
22- #[ derive( Clone , Debug , Serialize ) ]
22+ #[ derive( Clone , Debug , Serialize , Default ) ]
2323#[ serde( rename_all = "camelCase" ) ]
2424#[ non_exhaustive]
2525pub struct InsertOneResult {
@@ -37,26 +37,18 @@ impl InsertOneResult {
3737
3838/// The result of a [`Collection::insert_many`](../struct.Collection.html#method.insert_many)
3939/// operation.
40- #[ derive( Debug , Serialize ) ]
40+ #[ derive( Debug , Serialize , Default ) ]
4141#[ serde( rename_all = "camelCase" ) ]
4242#[ non_exhaustive]
4343pub struct InsertManyResult {
4444 /// The `_id` field of the documents inserted.
4545 pub inserted_ids : HashMap < usize , Bson > ,
4646}
4747
48- impl InsertManyResult {
49- pub ( crate ) fn new ( ) -> Self {
50- InsertManyResult {
51- inserted_ids : HashMap :: new ( ) ,
52- }
53- }
54- }
55-
5648/// The result of a [`Collection::update_one`](../struct.Collection.html#method.update_one) or
5749/// [`Collection::update_many`](../struct.Collection.html#method.update_many) operation.
5850#[ skip_serializing_none]
59- #[ derive( Clone , Debug , Serialize ) ]
51+ #[ derive( Clone , Debug , Serialize , Default ) ]
6052#[ serde( rename_all = "camelCase" ) ]
6153#[ non_exhaustive]
6254pub struct UpdateResult {
@@ -74,7 +66,7 @@ pub struct UpdateResult {
7466
7567/// The result of a [`Collection::delete_one`](../struct.Collection.html#method.delete_one) or
7668/// [`Collection::delete_many`](../struct.Collection.html#method.delete_many) operation.
77- #[ derive( Clone , Debug , Serialize ) ]
69+ #[ derive( Clone , Debug , Serialize , Default ) ]
7870#[ serde( rename_all = "camelCase" ) ]
7971#[ non_exhaustive]
8072pub struct DeleteResult {
@@ -85,7 +77,7 @@ pub struct DeleteResult {
8577
8678/// Information about the index created as a result of a
8779/// [`Collection::create_index`](../struct.Collection.html#method.create_index).
88- #[ derive( Debug , Clone , PartialEq ) ]
80+ #[ derive( Debug , Clone , PartialEq , Default ) ]
8981#[ non_exhaustive]
9082pub struct CreateIndexResult {
9183 /// The name of the index created in the `createIndex` command.
@@ -94,7 +86,7 @@ pub struct CreateIndexResult {
9486
9587/// Information about the indexes created as a result of a
9688/// [`Collection::create_indexes`](../struct.Collection.html#method.create_indexes).
97- #[ derive( Debug , Clone , PartialEq ) ]
89+ #[ derive( Debug , Clone , PartialEq , Default ) ]
9890#[ non_exhaustive]
9991pub struct CreateIndexesResult {
10092 /// The list containing the names of all indexes created in the `createIndexes` command.
@@ -120,14 +112,15 @@ pub(crate) struct GetMoreResult {
120112
121113/// Describes the type of data store returned when executing
122114/// [`Database::list_collections`](../struct.Database.html#method.list_collections).
123- #[ derive( Debug , Clone , Serialize , Deserialize , PartialEq ) ]
115+ #[ derive( Debug , Clone , Serialize , Deserialize , PartialEq , Default ) ]
124116#[ serde( rename_all = "camelCase" ) ]
125117#[ non_exhaustive]
126118pub enum CollectionType {
127119 /// Indicates that the data store is a view.
128120 View ,
129121
130122 /// Indicates that the data store is a collection.
123+ #[ default]
131124 Collection ,
132125
133126 /// Indicates that the data store is a timeseries.
@@ -140,7 +133,7 @@ pub enum CollectionType {
140133///
141134/// See the MongoDB [manual](https://www.mongodb.com/docs/manual/reference/command/listCollections/#listCollections.cursor)
142135/// for more information.
143- #[ derive( Debug , Clone , Deserialize , Serialize ) ]
136+ #[ derive( Debug , Clone , Deserialize , Serialize , Default ) ]
144137#[ serde( rename_all = "camelCase" ) ]
145138#[ non_exhaustive]
146139pub struct CollectionSpecificationInfo {
@@ -155,7 +148,7 @@ pub struct CollectionSpecificationInfo {
155148
156149/// Information about a collection as reported by
157150/// [`Database::list_collections`](../struct.Database.html#method.list_collections).
158- #[ derive( Debug , Clone , Deserialize , Serialize ) ]
151+ #[ derive( Debug , Clone , Deserialize , Serialize , Default ) ]
159152#[ serde( rename_all = "camelCase" ) ]
160153#[ non_exhaustive]
161154pub struct CollectionSpecification {
@@ -179,7 +172,7 @@ pub struct CollectionSpecification {
179172
180173/// A struct modeling the information about an individual database returned from
181174/// [`Client::list_databases`](../struct.Client.html#method.list_databases).
182- #[ derive( Debug , Clone , Deserialize , Serialize , PartialEq ) ]
175+ #[ derive( Debug , Clone , Deserialize , Serialize , PartialEq , Default ) ]
183176#[ serde( rename_all = "camelCase" ) ]
184177#[ non_exhaustive]
185178pub struct DatabaseSpecification {
0 commit comments