File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -922,6 +922,38 @@ pub unsafe extern "C" fn cass_result_column_name(
922922 CassError :: CASS_OK
923923}
924924
925+ #[ no_mangle]
926+ pub unsafe extern "C" fn cass_result_column_type (
927+ result : * const CassResult ,
928+ index : size_t ,
929+ ) -> CassValueType {
930+ let result_from_raw: & CassResult = ptr_to_ref ( result) ;
931+ let index_usize: usize = index. try_into ( ) . unwrap ( ) ;
932+
933+ result_from_raw
934+ . metadata
935+ . col_data_types
936+ . get ( index_usize)
937+ . map ( |arc_data_type| cass_data_type_type ( Arc :: as_ptr ( arc_data_type) ) )
938+ . unwrap_or ( CassValueType :: CASS_VALUE_TYPE_UNKNOWN )
939+ }
940+
941+ #[ no_mangle]
942+ pub unsafe extern "C" fn cass_result_column_data_type (
943+ result : * const CassResult ,
944+ index : size_t ,
945+ ) -> * const CassDataType {
946+ let result_from_raw: & CassResult = ptr_to_ref ( result) ;
947+ let index_usize: usize = index. try_into ( ) . unwrap ( ) ;
948+
949+ result_from_raw
950+ . metadata
951+ . col_data_types
952+ . get ( index_usize)
953+ . map ( Arc :: as_ptr)
954+ . unwrap_or ( std:: ptr:: null ( ) )
955+ }
956+
925957#[ no_mangle]
926958pub unsafe extern "C" fn cass_value_type ( value : * const CassValue ) -> CassValueType {
927959 let value_from_raw = ptr_to_ref ( value) ;
You can’t perform that action at this time.
0 commit comments