GRPC Core  9.0.0
Functions
metadata_batch.cc File Reference
#include <grpc/support/port_platform.h>
#include "src/core/lib/transport/metadata_batch.h"
#include <stdbool.h>
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/slice/slice_string_helpers.h"

Functions

void grpc_metadata_batch_assert_ok (grpc_metadata_batch *batch)
 
void grpc_metadata_batch_init (grpc_metadata_batch *batch)
 
void grpc_metadata_batch_destroy (grpc_metadata_batch *batch)
 
grpc_error * grpc_attach_md_to_error (grpc_error *src, grpc_mdelem md)
 
grpc_error * grpc_metadata_batch_add_head (grpc_metadata_batch *batch, grpc_linked_mdelem *storage, grpc_mdelem elem_to_add)
 Add elem_to_add as the first element in batch, using storage as backing storage for the linked list element. More...
 
grpc_error * grpc_metadata_batch_link_head (grpc_metadata_batch *batch, grpc_linked_mdelem *storage)
 Add storage to the beginning of batch. More...
 
grpc_error * grpc_metadata_batch_link_head (grpc_metadata_batch *batch, grpc_linked_mdelem *storage, grpc_metadata_batch_callouts_index idx)
 
grpc_error * grpc_metadata_batch_add_tail (grpc_metadata_batch *batch, grpc_linked_mdelem *storage, grpc_mdelem elem_to_add)
 Add elem_to_add as the last element in batch, using storage as backing storage for the linked list element. More...
 
grpc_error * grpc_metadata_batch_link_tail (grpc_metadata_batch *batch, grpc_linked_mdelem *storage)
 Add storage to the end of batch. More...
 
grpc_error * grpc_metadata_batch_link_tail (grpc_metadata_batch *batch, grpc_linked_mdelem *storage, grpc_metadata_batch_callouts_index idx)
 
void grpc_metadata_batch_remove (grpc_metadata_batch *batch, grpc_linked_mdelem *storage)
 Remove storage from the batch, unreffing the mdelem contained. More...
 
void grpc_metadata_batch_remove (grpc_metadata_batch *batch, grpc_metadata_batch_callouts_index idx)
 
void grpc_metadata_batch_set_value (grpc_linked_mdelem *storage, const grpc_slice &value)
 
grpc_error * grpc_metadata_batch_substitute (grpc_metadata_batch *batch, grpc_linked_mdelem *storage, grpc_mdelem new_mdelem)
 Substitute a new mdelem for an old value. More...
 
void grpc_metadata_batch_clear (grpc_metadata_batch *batch)
 
bool grpc_metadata_batch_is_empty (grpc_metadata_batch *batch)
 
size_t grpc_metadata_batch_size (grpc_metadata_batch *batch)
 
grpc_error * grpc_metadata_batch_filter (grpc_metadata_batch *batch, grpc_metadata_batch_filter_func func, void *user_data, const char *composite_error_string)
 
void grpc_metadata_batch_copy (grpc_metadata_batch *src, grpc_metadata_batch *dst, grpc_linked_mdelem *storage)
 Copies src to dst. More...
 
void grpc_metadata_batch_move (grpc_metadata_batch *src, grpc_metadata_batch *dst)
 

Function Documentation

◆ grpc_attach_md_to_error()

grpc_error* grpc_attach_md_to_error ( grpc_error *  src,
grpc_mdelem  md 
)

◆ grpc_metadata_batch_add_head()

grpc_error* grpc_metadata_batch_add_head ( grpc_metadata_batch *  batch,
grpc_linked_mdelem *  storage,
grpc_mdelem  elem_to_add 
)

Add elem_to_add as the first element in batch, using storage as backing storage for the linked list element.

storage is owned by the caller and must survive for the lifetime of batch. This usually means it should be around for the lifetime of the call. Takes ownership of elem_to_add

◆ grpc_metadata_batch_add_tail()

grpc_error* grpc_metadata_batch_add_tail ( grpc_metadata_batch *  batch,
grpc_linked_mdelem *  storage,
grpc_mdelem  elem_to_add 
)

Add elem_to_add as the last element in batch, using storage as backing storage for the linked list element.

storage is owned by the caller and must survive for the lifetime of batch. This usually means it should be around for the lifetime of the call. Takes ownership of elem_to_add

◆ grpc_metadata_batch_assert_ok()

void grpc_metadata_batch_assert_ok ( grpc_metadata_batch *  batch)

◆ grpc_metadata_batch_clear()

void grpc_metadata_batch_clear ( grpc_metadata_batch *  batch)

◆ grpc_metadata_batch_copy()

void grpc_metadata_batch_copy ( grpc_metadata_batch *  src,
grpc_metadata_batch *  dst,
grpc_linked_mdelem *  storage 
)

Copies src to dst.

storage must point to an array of grpc_linked_mdelem structs of at least the same size as src.

◆ grpc_metadata_batch_destroy()

void grpc_metadata_batch_destroy ( grpc_metadata_batch *  batch)

◆ grpc_metadata_batch_filter()

grpc_error* grpc_metadata_batch_filter ( grpc_metadata_batch *  batch,
grpc_metadata_batch_filter_func  func,
void *  user_data,
const char *  composite_error_string 
)

◆ grpc_metadata_batch_init()

void grpc_metadata_batch_init ( grpc_metadata_batch *  batch)

◆ grpc_metadata_batch_is_empty()

bool grpc_metadata_batch_is_empty ( grpc_metadata_batch *  batch)

◆ grpc_metadata_batch_link_head() [1/2]

grpc_error* grpc_metadata_batch_link_head ( grpc_metadata_batch *  batch,
grpc_linked_mdelem *  storage 
)

Add storage to the beginning of batch.

storage->md is assumed to be valid. storage is owned by the caller and must survive for the lifetime of batch. This usually means it should be around for the lifetime of the call.

◆ grpc_metadata_batch_link_head() [2/2]

grpc_error* grpc_metadata_batch_link_head ( grpc_metadata_batch *  batch,
grpc_linked_mdelem *  storage,
grpc_metadata_batch_callouts_index  idx 
)

◆ grpc_metadata_batch_link_tail() [1/2]

grpc_error* grpc_metadata_batch_link_tail ( grpc_metadata_batch *  batch,
grpc_linked_mdelem *  storage 
)

Add storage to the end of batch.

storage->md is assumed to be valid. storage is owned by the caller and must survive for the lifetime of batch. This usually means it should be around for the lifetime of the call.

◆ grpc_metadata_batch_link_tail() [2/2]

grpc_error* grpc_metadata_batch_link_tail ( grpc_metadata_batch *  batch,
grpc_linked_mdelem *  storage,
grpc_metadata_batch_callouts_index  idx 
)

◆ grpc_metadata_batch_move()

void grpc_metadata_batch_move ( grpc_metadata_batch *  src,
grpc_metadata_batch *  dst 
)

◆ grpc_metadata_batch_remove() [1/2]

void grpc_metadata_batch_remove ( grpc_metadata_batch *  batch,
grpc_linked_mdelem *  storage 
)

Remove storage from the batch, unreffing the mdelem contained.

◆ grpc_metadata_batch_remove() [2/2]

void grpc_metadata_batch_remove ( grpc_metadata_batch *  batch,
grpc_metadata_batch_callouts_index  idx 
)

◆ grpc_metadata_batch_set_value()

void grpc_metadata_batch_set_value ( grpc_linked_mdelem *  storage,
const grpc_slice &  value 
)

◆ grpc_metadata_batch_size()

size_t grpc_metadata_batch_size ( grpc_metadata_batch *  batch)

◆ grpc_metadata_batch_substitute()

grpc_error* grpc_metadata_batch_substitute ( grpc_metadata_batch *  batch,
grpc_linked_mdelem *  storage,
grpc_mdelem  new_mdelem 
)

Substitute a new mdelem for an old value.