@@ -26,7 +26,6 @@ use std::num::NonZeroUsize;
26
26
use std:: str:: FromStr ;
27
27
use std:: sync:: Arc ;
28
28
use std:: time:: { Duration , Instant } ;
29
- use strum_macros:: EnumString ;
30
29
use tokio:: sync:: { broadcast, mpsc} ;
31
30
use tracing:: { debug, error, trace, warn} ;
32
31
use uuid:: Uuid ;
@@ -348,15 +347,32 @@ pub enum CollectionType {
348
347
Set ( Box < CqlType > ) ,
349
348
}
350
349
351
- #[ derive( Clone , Debug , PartialEq , Eq , EnumString ) ]
352
- #[ strum( serialize_all = "snake_case" ) ]
350
+ #[ derive( Clone , Debug , PartialEq , Eq ) ]
353
351
pub enum ColumnKind {
354
352
Regular ,
355
353
Static ,
356
354
Clustering ,
357
355
PartitionKey ,
358
356
}
359
357
358
+ /// [ColumnKind] parse error
359
+ #[ derive( Clone , Copy , Debug , PartialEq , Eq ) ]
360
+ pub struct ColumnKindFromStrError ;
361
+
362
+ impl std:: str:: FromStr for ColumnKind {
363
+ type Err = ColumnKindFromStrError ;
364
+
365
+ fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
366
+ match s {
367
+ "regular" => Ok ( Self :: Regular ) ,
368
+ "static" => Ok ( Self :: Static ) ,
369
+ "clustering" => Ok ( Self :: Clustering ) ,
370
+ "partition_key" => Ok ( Self :: PartitionKey ) ,
371
+ _ => Err ( ColumnKindFromStrError ) ,
372
+ }
373
+ }
374
+ }
375
+
360
376
#[ derive( Clone , Debug , PartialEq , Eq ) ]
361
377
#[ allow( clippy:: enum_variant_names) ]
362
378
pub enum Strategy {
0 commit comments