@@ -26,7 +26,6 @@ use std::num::NonZeroUsize;
2626use std:: str:: FromStr ;
2727use std:: sync:: Arc ;
2828use std:: time:: { Duration , Instant } ;
29- use strum_macros:: EnumString ;
3029use tokio:: sync:: { broadcast, mpsc} ;
3130use tracing:: { debug, error, trace, warn} ;
3231use uuid:: Uuid ;
@@ -348,15 +347,32 @@ pub enum CollectionType {
348347 Set ( Box < CqlType > ) ,
349348}
350349
351- #[ derive( Clone , Debug , PartialEq , Eq , EnumString ) ]
352- #[ strum( serialize_all = "snake_case" ) ]
350+ #[ derive( Clone , Debug , PartialEq , Eq ) ]
353351pub enum ColumnKind {
354352 Regular ,
355353 Static ,
356354 Clustering ,
357355 PartitionKey ,
358356}
359357
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+
360376#[ derive( Clone , Debug , PartialEq , Eq ) ]
361377#[ allow( clippy:: enum_variant_names) ]
362378pub enum Strategy {
0 commit comments