File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -934,6 +934,34 @@ pub unsafe extern "C" fn cass_result_column_name(
934934 CassError :: CASS_OK
935935}
936936
937+ #[ no_mangle]
938+ pub unsafe extern "C" fn cass_result_column_type (
939+ result : * const CassResult ,
940+ index : size_t ,
941+ ) -> CassValueType {
942+ let data_type_ptr = cass_result_column_data_type ( result, index) ;
943+ if data_type_ptr. is_null ( ) {
944+ return CassValueType :: CASS_VALUE_TYPE_UNKNOWN ;
945+ }
946+ cass_data_type_type ( data_type_ptr)
947+ }
948+
949+ #[ no_mangle]
950+ pub unsafe extern "C" fn cass_result_column_data_type (
951+ result : * const CassResult ,
952+ index : size_t ,
953+ ) -> * const CassDataType {
954+ let result_from_raw: & CassResult = ptr_to_ref ( result) ;
955+ let index_usize: usize = index. try_into ( ) . unwrap ( ) ;
956+
957+ result_from_raw
958+ . metadata
959+ . col_data_types
960+ . get ( index_usize)
961+ . map ( Arc :: as_ptr)
962+ . unwrap_or ( std:: ptr:: null ( ) )
963+ }
964+
937965#[ no_mangle]
938966pub unsafe extern "C" fn cass_value_type ( value : * const CassValue ) -> CassValueType {
939967 let value_from_raw = ptr_to_ref ( value) ;
You can’t perform that action at this time.
0 commit comments