File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -27,3 +27,24 @@ impl CassConsistency {
2727pub unsafe extern "C" fn cass_consistency_string ( consistency : CassConsistency ) -> * const c_char {
2828 consistency. as_cstr ( ) . as_ptr ( ) as * const c_char
2929}
30+
31+ impl CassWriteType {
32+ pub ( crate ) fn as_cstr ( & self ) -> & ' static CStr {
33+ match * self {
34+ Self :: CASS_WRITE_TYPE_SIMPLE => c"SIMPLE" ,
35+ Self :: CASS_WRITE_TYPE_BATCH => c"BATCH" ,
36+ Self :: CASS_WRITE_TYPE_UNLOGGED_BATCH => c"UNLOGGED_BATCH" ,
37+ Self :: CASS_WRITE_TYPE_COUNTER => c"COUNTER" ,
38+ Self :: CASS_WRITE_TYPE_BATCH_LOG => c"BATCH_LOG" ,
39+ Self :: CASS_WRITE_TYPE_CAS => c"CAS" ,
40+ Self :: CASS_WRITE_TYPE_VIEW => c"VIEW" ,
41+ Self :: CASS_WRITE_TYPE_CDC => c"CDC" ,
42+ _ => c"" ,
43+ }
44+ }
45+ }
46+
47+ #[ no_mangle]
48+ pub unsafe extern "C" fn cass_write_type_string ( write_type : CassWriteType ) -> * const c_char {
49+ write_type. as_cstr ( ) . as_ptr ( ) as * const c_char
50+ }
You can’t perform that action at this time.
0 commit comments