@@ -7,7 +7,7 @@ use std::{
7
7
} ;
8
8
9
9
use bson:: Bson ;
10
- use serde:: Deserialize ;
10
+ use serde:: { Deserialize , Serialize } ;
11
11
use thiserror:: Error ;
12
12
13
13
use crate :: { bson:: Document , options:: ServerAddress , sdam:: TopologyVersion } ;
@@ -597,7 +597,7 @@ impl ErrorKind {
597
597
}
598
598
599
599
/// An error that occurred due to a database command failing.
600
- #[ derive( Clone , Debug , Deserialize ) ]
600
+ #[ derive( Clone , Debug , Serialize , Deserialize ) ]
601
601
#[ non_exhaustive]
602
602
pub struct CommandError {
603
603
/// Identifies the type of error.
@@ -637,7 +637,7 @@ impl fmt::Display for CommandError {
637
637
}
638
638
639
639
/// An error that occurred due to not being able to satisfy a write concern.
640
- #[ derive( Clone , Debug , Deserialize , PartialEq ) ]
640
+ #[ derive( Clone , Debug , Serialize , Deserialize , PartialEq ) ]
641
641
#[ non_exhaustive]
642
642
pub struct WriteConcernError {
643
643
/// Identifies the type of write concern error.
@@ -673,7 +673,7 @@ impl WriteConcernError {
673
673
674
674
/// An error that occurred during a write operation that wasn't due to being unable to satisfy a
675
675
/// write concern.
676
- #[ derive( Clone , Debug , PartialEq , Deserialize ) ]
676
+ #[ derive( Clone , Debug , PartialEq , Serialize , Deserialize ) ]
677
677
#[ non_exhaustive]
678
678
pub struct WriteError {
679
679
/// Identifies the type of write error.
@@ -707,7 +707,7 @@ impl WriteError {
707
707
708
708
/// An error that occurred during a write operation consisting of multiple writes that wasn't due to
709
709
/// being unable to satisfy a write concern.
710
- #[ derive( Debug , PartialEq , Clone , Deserialize ) ]
710
+ #[ derive( Debug , PartialEq , Clone , Serialize , Deserialize ) ]
711
711
#[ non_exhaustive]
712
712
pub struct BulkWriteError {
713
713
/// Index into the list of operations that this error corresponds to.
@@ -744,7 +744,7 @@ impl BulkWriteError {
744
744
}
745
745
746
746
/// The set of errors that occurred during a write operation.
747
- #[ derive( Clone , Debug , Deserialize ) ]
747
+ #[ derive( Clone , Debug , Serialize , Deserialize ) ]
748
748
#[ serde( rename_all = "camelCase" ) ]
749
749
#[ non_exhaustive]
750
750
pub struct BulkWriteFailure {
@@ -769,7 +769,7 @@ impl BulkWriteFailure {
769
769
}
770
770
771
771
/// An error that occurred when trying to execute a write operation.
772
- #[ derive( Clone , Debug ) ]
772
+ #[ derive( Clone , Debug , Serialize , Deserialize ) ]
773
773
#[ non_exhaustive]
774
774
pub enum WriteFailure {
775
775
/// An error that occurred due to not being able to satisfy a write concern.
0 commit comments