Go to the documentation of this file.
19 #ifndef GRPC_IMPL_GRPC_TYPES_H
20 #define GRPC_IMPL_GRPC_TYPES_H
85 void* (*copy)(
void* p);
87 int (*
cmp)(
void* p,
void* q);
179 #define GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH (-1)
180 #define GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH (4 * 1024 * 1024)
186 #define GRPC_WRITE_BUFFER_HINT (0x00000001u)
189 #define GRPC_WRITE_NO_COMPRESS (0x00000002u)
191 #define GRPC_WRITE_THROUGH (0x00000004u)
193 #define GRPC_WRITE_USED_MASK \
194 (GRPC_WRITE_BUFFER_HINT | GRPC_WRITE_NO_COMPRESS | GRPC_WRITE_THROUGH)
199 #define GRPC_INITIAL_METADATA_WAIT_FOR_READY (0x00000020u)
202 #define GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET (0x00000080u)
205 #define GRPC_INITIAL_METADATA_USED_MASK \
206 (GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET | \
207 GRPC_INITIAL_METADATA_WAIT_FOR_READY | GRPC_WRITE_THROUGH)
460 #define GRPC_CQ_CURRENT_VERSION 2
461 #define GRPC_CQ_VERSION_MINIMUM_FOR_CALLBACKABLE 2
A single argument...
Definition: grpc_types.h:102
struct grpc_byte_buffer * send_message
This op takes ownership of the slices in send_message.
Definition: grpc_types.h:339
uint32_t flags
Write flags bitset for grpc_begin_messages.
Definition: grpc_types.h:315
grpc_call_error
Result of a grpc call.
Definition: grpc_types.h:140
@ GRPC_CALL_ERROR_ALREADY_INVOKED
this method must be called before invoke
Definition: grpc_types.h:152
grpc_metadata_array * trailing_metadata
ownership of the array is with the caller, but ownership of the elements stays with the call object (...
Definition: grpc_types.h:372
grpc_completion_type
The type of completion (for grpc_event)
Definition: grpc_types.h:225
struct grpc_metadata grpc_metadata
A single metadata element.
grpc_status_code * status
Definition: grpc_types.h:373
grpc_arg_type
Type specifier for grpc_arg.
Definition: grpc_types.h:78
@ GRPC_CALL_ERROR_TOO_MANY_OPERATIONS
there is already an outstanding read/write operation on the call
Definition: grpc_types.h:159
@ GRPC_ARG_INTEGER
Definition: grpc_types.h:80
@ GRPC_CQ_NEXT
Events are popped out by calling grpc_completion_queue_next() API ONLY.
Definition: grpc_types.h:431
Definition: grpc_types.h:341
struct grpc_socket_mutator grpc_socket_mutator
The Socket Mutator interface allows changes on socket options.
Definition: grpc_types.h:72
struct grpc_resource_quota grpc_resource_quota
Definition: grpc_types.h:400
@ GRPC_CALL_ERROR
something failed, we don't know what
Definition: grpc_types.h:144
@ GRPC_CALL_ERROR_INVALID_MESSAGE
invalid message was passed to this call
Definition: grpc_types.h:165
@ GRPC_ARG_STRING
Definition: grpc_types.h:79
grpc_cq_polling_type
Completion queues internally MAY maintain a set of file descriptors in a structure called 'pollset'.
Definition: grpc_types.h:411
struct grpc_op::grpc_op_data::grpc_op_send_initial_metadata send_initial_metadata
struct grpc_byte_buffer grpc_byte_buffer
grpc_status_code
Definition: status.h:28
int internal_success
The following fields are not API.
Definition: grpc_types.h:456
struct grpc_op grpc_op
Operation data: one field for each op type (except SEND_CLOSE_FROM_CLIENT which has no arguments)
struct grpc_byte_buffer::grpc_byte_buffer_data::grpc_compressed_buffer raw
Definition: grpc_types.h:258
void * reserved
Reserved for future usage.
Definition: grpc_types.h:317
grpc_compression_algorithm
The various compression algorithms supported by gRPC (not sorted by compression level)
Definition: compression_types.h:60
grpc_cq_completion_type
Specifies the type of APIs to use to pop events from the completion queue.
Definition: grpc_types.h:429
@ GRPC_CALL_ERROR_NOT_ON_CLIENT
this method is not available on the client
Definition: grpc_types.h:148
Definition: grpc_types.h:333
Definition: grpc_types.h:45
@ GRPC_CALL_ERROR_COMPLETION_QUEUE_SHUTDOWN
completion queue has been shutdown
Definition: grpc_types.h:174
@ GRPC_QUEUE_SHUTDOWN
Shutting down.
Definition: grpc_types.h:227
void * reserved
Definition: grpc_types.h:43
@ GRPC_OP_COMPLETE
Operation completion.
Definition: grpc_types.h:231
@ GRPC_CALL_OK
everything went ok
Definition: grpc_types.h:142
struct grpc_event grpc_event
The result of an operation.
grpc_slice method
Definition: grpc_types.h:259
@ GRPC_CALL_ERROR_INVALID_METADATA
invalid metadata was passed to this call
Definition: grpc_types.h:163
@ GRPC_CALL_ERROR_NOT_ON_SERVER
this method is not available on the server
Definition: grpc_types.h:146
Definition: grpc_types.h:84
An array of arguments that can be passed around.
Definition: grpc_types.h:131
struct grpc_op::grpc_op_data::grpc_op_recv_message recv_message
@ GRPC_BB_RAW
Future types may include GRPC_BB_PROTOBUF, etc.
Definition: grpc_types.h:38
@ GRPC_CQ_NON_POLLING
The completion queue will not have an associated pollset.
Definition: grpc_types.h:425
union grpc_op::grpc_op_data data
Definition: grpc_types.h:366
grpc_byte_buffer_type type
Definition: grpc_types.h:44
struct grpc_completion_queue_functor grpc_completion_queue_functor
Specifies an interface class to be used as a tag for callback-based completion queues.
struct grpc_byte_buffer ** recv_message
Definition: grpc_types.h:364
@ GRPC_CQ_DEFAULT_POLLING
The completion queue will have an associated pollset and there is no restriction on the type of file ...
Definition: grpc_types.h:414
@ GRPC_OP_RECV_INITIAL_METADATA
Receive initial metadata: one and only one MUST be made on the client, must not be made on the server...
Definition: grpc_types.h:288
char * string
Definition: grpc_types.h:106
void(* functor_run)(struct grpc_completion_queue_functor *, int)
The run member specifies a function that will be called when this tag is extracted from the completio...
Definition: grpc_types.h:449
@ GRPC_CALL_ERROR_NOT_INVOKED
this method must be called after invoke
Definition: grpc_types.h:154
@ GRPC_CQ_NON_LISTENING
Similar to GRPC_CQ_DEFAULT_POLLING except that the completion queues will not contain any 'listening ...
Definition: grpc_types.h:419
@ GRPC_OP_SEND_STATUS_FROM_SERVER
Send status from the server: one and only one instance MUST be sent from the server unless the call w...
Definition: grpc_types.h:283
const grpc_arg_pointer_vtable * vtable
Definition: grpc_types.h:110
@ GRPC_CALL_ERROR_INVALID_FLAGS
the flags value was illegal for this call
Definition: grpc_types.h:161
grpc_status_code status
Definition: grpc_types.h:344
void * reserved[8]
Definition: grpc_types.h:321
Definition: grpc_types.h:108
const char ** error_string
If this is not nullptr, it will be populated with the full fidelity error string for debugging purpos...
Definition: grpc_types.h:378
The result of an operation.
Definition: grpc_types.h:237
grpc_op_type
Definition: grpc_types.h:264
struct grpc_call grpc_call
A Call represents an RPC.
Definition: grpc_types.h:69
Definition: grpc_types.h:42
Operation data: one field for each op type (except SEND_CLOSE_FROM_CLIENT which has no arguments)
Definition: grpc_types.h:311
@ GRPC_OP_SEND_MESSAGE
Send a message: 0 or more of these operations can occur for each call.
Definition: grpc_types.h:273
size_t num_args
Definition: grpc_types.h:132
struct grpc_completion_queue_functor * internal_next
Definition: grpc_types.h:457
Definition: grpc_types.h:380
grpc_metadata * trailing_metadata
Definition: grpc_types.h:343
A grpc_slice s, if initialized, represents the byte range s.bytes[0..s.length-1].
Definition: slice_type.h:63
void * p
Definition: grpc_types.h:109
struct grpc_socket_factory grpc_socket_factory
The Socket Factory interface creates and binds sockets.
Definition: grpc_types.h:75
struct grpc_server grpc_server
A server listens to some port and responds to request calls.
Definition: grpc_types.h:64
struct grpc_arg_pointer_vtable grpc_arg_pointer_vtable
void(* destroy)(void *p)
Definition: grpc_types.h:86
@ GRPC_CQ_PLUCK
Events are popped out by calling grpc_completion_queue_pluck() API ONLY.
Definition: grpc_types.h:434
Definition: grpc_types.h:462
int version
The version number of this structure.
Definition: grpc_types.h:465
grpc_op_type op
Operation type, as defined by grpc_op_type.
Definition: grpc_types.h:313
grpc_slice * status_details
Definition: grpc_types.h:374
union grpc_byte_buffer::grpc_byte_buffer_data data
struct grpc_completion_queue_factory grpc_completion_queue_factory
The completion queue factory structure is opaque to the callers of grpc.
Definition: grpc_types.h:482
struct grpc_op::grpc_op_data::grpc_op_recv_close_on_server recv_close_on_server
@ GRPC_OP_RECV_MESSAGE
Receive a message: 0 or more of these operations can occur for each call.
Definition: grpc_types.h:292
@ GRPC_CALL_ERROR_ALREADY_ACCEPTED
this method must be called before server_accept
Definition: grpc_types.h:150
grpc_completion_queue_functor * cq_shutdown_cb
When creating a callbackable CQ, pass in a functor to get invoked when shutdown is complete.
Definition: grpc_types.h:476
char ** service_config_json
If non-NULL, will be set to point to a string containing the service config used by the channel in JS...
Definition: grpc_types.h:397
struct grpc_op::grpc_op_data::grpc_op_send_status_from_server send_status_from_server
@ GRPC_CALL_ERROR_PAYLOAD_TYPE_MISMATCH
payload type requested is not the type registered
Definition: grpc_types.h:172
grpc_slice host
Definition: grpc_types.h:260
@ GRPC_OP_SEND_INITIAL_METADATA
Send initial metadata: one and only one instance MUST be sent for each call, unless the call was canc...
Definition: grpc_types.h:269
char ** lb_policy_name
If non-NULL, will be set to point to a string indicating the LB policy name.
Definition: grpc_types.h:394
struct grpc_op::grpc_op_data::grpc_op_send_message send_message
grpc_compression_algorithm compression
Definition: grpc_types.h:50
grpc_byte_buffer_type
Definition: grpc_types.h:37
@ GRPC_CALL_ERROR_BATCH_TOO_BIG
this batch of operations leads to more operations than allowed
Definition: grpc_types.h:170
struct grpc_op::grpc_op_data::grpc_op_recv_status_on_client recv_status_on_client
grpc_compression_level
Compression levels allow a party with knowledge of its peer's accepted encodings to request compressi...
Definition: compression_types.h:72
size_t trailing_metadata_count
Definition: grpc_types.h:342
char * key
Definition: grpc_types.h:104
Definition: grpc_types.h:318
Definition: grpc_types.h:49
struct grpc_completion_queue grpc_completion_queue
Completion Queues enable notification of the completion of asynchronous actions.
Definition: grpc_types.h:58
ownership of the byte buffer is moved to the caller; the caller must call grpc_byte_buffer_destroy on...
Definition: grpc_types.h:363
Specifies an interface class to be used as a tag for callback-based completion queues.
Definition: grpc_types.h:444
grpc_cq_completion_type cq_completion_type
Set to GRPC_CQ_CURRENT_VERSION.
Definition: grpc_types.h:467
struct grpc_channel grpc_channel
The Channel interface allows creation of Call objects.
Definition: grpc_types.h:61
grpc_slice_buffer slice_buffer
Definition: grpc_types.h:51
@ GRPC_OP_RECV_CLOSE_ON_SERVER
Receive close on the server: one and only one must be made on the server.
Definition: grpc_types.h:304
struct grpc_completion_queue_attributes grpc_completion_queue_attributes
@ GRPC_CALL_ERROR_ALREADY_FINISHED
this call is already finished (writes_done or write_status has already been called)
Definition: grpc_types.h:157
grpc_cq_polling_type cq_polling_type
Definition: grpc_types.h:469
Represents an expandable array of slices, to be interpreted as a single item.
Definition: slice_type.h:81
struct grpc_op::grpc_op_data::grpc_op_recv_initial_metadata recv_initial_metadata
@ GRPC_ARG_POINTER
Definition: grpc_types.h:81
grpc_slice * status_details
optional: set to NULL if no details need sending, non-NULL if they do pointer will not be retained pa...
Definition: grpc_types.h:348
@ GRPC_CQ_CALLBACK
Events trigger a callback specified as the tag.
Definition: grpc_types.h:437
Analogous to struct timespec.
Definition: time.h:48
grpc_completion_type type
The type of the completion.
Definition: grpc_types.h:239
int integer
Definition: grpc_types.h:107
void * reserved[8]
Definition: grpc_types.h:47
@ GRPC_OP_RECV_STATUS_ON_CLIENT
Receive status on the client: one and only one must be made on the client.
Definition: grpc_types.h:298
grpc_arg_type type
Definition: grpc_types.h:103
int(* cmp)(void *p, void *q)
Definition: grpc_types.h:87
Information requested from the channel.
Definition: grpc_types.h:391
grpc_arg * args
Definition: grpc_types.h:133
gpr_timespec deadline
Definition: grpc_types.h:261
int success
If the grpc_completion_type is GRPC_OP_COMPLETE, this field indicates whether the operation was succe...
Definition: grpc_types.h:245
@ GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE
completion queue for notification has not been registered with the server
Definition: grpc_types.h:168
@ GRPC_QUEUE_TIMEOUT
No event before timeout.
Definition: grpc_types.h:229
void * tag
The tag passed to grpc_call_start_batch etc to start this operation.
Definition: grpc_types.h:249
int * cancelled
out argument, set to 1 if the call failed at the server for a reason other than a non-OK status (canc...
Definition: grpc_types.h:385
@ GRPC_OP_SEND_CLOSE_FROM_CLIENT
Send a close from the client: one and only one instance MUST be sent from the client,...
Definition: grpc_types.h:278
Definition: grpc_types.h:105
int inlineable
The inlineable member specifies whether this functor can be run inline.
Definition: grpc_types.h:453