@@ -12,31 +12,10 @@ use super::response::result::CqlValue;
1212use super :: types:: vint_encode;
1313use super :: types:: RawValue ;
1414
15- #[ derive( Debug , Error , Clone , Copy , PartialEq , Eq , PartialOrd , Ord ) ]
16- #[ error( "Value too big to be sent in a request - max 2GiB allowed" ) ]
17- #[ deprecated(
18- since = "0.15.1" ,
19- note = "Legacy serialization API is not type-safe and is going to be removed soon"
20- ) ]
21- pub struct ValueTooBig ;
22-
2315#[ derive( Debug , Error , Clone , Copy , PartialEq , Eq , PartialOrd , Ord ) ]
2416#[ error( "Value is too large to fit in the CQL type" ) ]
2517pub struct ValueOverflow ;
2618
27- #[ allow( deprecated) ]
28- #[ derive( Debug , Error , Clone , Copy , PartialEq , Eq , PartialOrd , Ord ) ]
29- pub enum SerializeValuesError {
30- #[ error( "Too many values to add, max 65,535 values can be sent in a request" ) ]
31- TooManyValues ,
32- #[ error( "Mixing named and not named values is not allowed" ) ]
33- MixingNamedAndNotNamedValues ,
34- #[ error( transparent) ]
35- ValueTooBig ( #[ from] ValueTooBig ) ,
36- #[ error( "Parsing serialized values failed" ) ]
37- ParseError ,
38- }
39-
4019/// Represents an unset value
4120#[ derive( Debug , Clone , Copy , PartialEq , Eq , PartialOrd , Ord ) ]
4221pub struct Unset ;
@@ -684,6 +663,22 @@ mod legacy {
684663 fn serialize ( & self , buf : & mut Vec < u8 > ) -> Result < ( ) , ValueTooBig > ;
685664 }
686665
666+ #[ derive( Debug , Error , Clone , Copy , PartialEq , Eq , PartialOrd , Ord ) ]
667+ #[ error( "Value too big to be sent in a request - max 2GiB allowed" ) ]
668+ pub struct ValueTooBig ;
669+
670+ #[ derive( Debug , Error , Clone , Copy , PartialEq , Eq , PartialOrd , Ord ) ]
671+ pub enum SerializeValuesError {
672+ #[ error( "Too many values to add, max 65,535 values can be sent in a request" ) ]
673+ TooManyValues ,
674+ #[ error( "Mixing named and not named values is not allowed" ) ]
675+ MixingNamedAndNotNamedValues ,
676+ #[ error( transparent) ]
677+ ValueTooBig ( #[ from] ValueTooBig ) ,
678+ #[ error( "Parsing serialized values failed" ) ]
679+ ParseError ,
680+ }
681+
687682 /// Keeps a buffer with serialized Values
688683 /// Allows adding new Values and iterating over serialized ones
689684 #[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord ) ]
@@ -1887,5 +1882,6 @@ mod legacy {
18871882pub use legacy:: {
18881883 LegacyBatchValues , LegacyBatchValuesFirstSerialized , LegacyBatchValuesFromIter ,
18891884 LegacyBatchValuesIterator , LegacyBatchValuesIteratorFromIterator , LegacySerializedValues ,
1890- LegacySerializedValuesIterator , SerializedResult , TupleValuesIter , Value , ValueList ,
1885+ LegacySerializedValuesIterator , SerializeValuesError , SerializedResult , TupleValuesIter , Value ,
1886+ ValueList , ValueTooBig ,
18911887} ;
0 commit comments