aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/ext/grpc/rb_call.h
blob: bfe8035e0fb7cba6c170e2da0d8743f9fbbc3e38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
 *
 * Copyright 2015 gRPC authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

#ifndef GRPC_RB_CALL_H_
#define GRPC_RB_CALL_H_

#include <ruby/ruby.h>

#include <grpc/grpc.h>

/* Gets the wrapped call from a VALUE. */
grpc_call *grpc_rb_get_wrapped_call(VALUE v);

/* Gets the VALUE corresponding to given grpc_call. */
VALUE grpc_rb_wrap_call(grpc_call *c, grpc_completion_queue *q);

/* Provides the details of an call error */
const char *grpc_call_error_detail_of(grpc_call_error err);

/* Converts a metadata array to a hash. */
VALUE grpc_rb_md_ary_to_h(grpc_metadata_array *md_ary);

/* grpc_rb_md_ary_convert converts a ruby metadata hash into
   a grpc_metadata_array.
*/
void grpc_rb_md_ary_convert(VALUE md_ary_hash, grpc_metadata_array *md_ary);

void grpc_rb_metadata_array_destroy_including_entries(
    grpc_metadata_array *md_ary);

/* grpc_rb_eCallError is the ruby class of the exception thrown during call
   operations. */
extern VALUE grpc_rb_eCallError;

/* Initializes the Call class. */
void Init_grpc_call();

#endif /* GRPC_RB_CALL_H_ */