opentracing-c
OpenTracing C API
Data Fields
opentracing_text_map_reader Struct Reference

The extract() carrier for the opentracing_propagation_format_text_map with it, the caller can decode a propagated span context as entries in a map of strings. More...

#include <opentracing-c/propagation.h>

Inheritance diagram for opentracing_text_map_reader:
[legend]
Collaboration diagram for opentracing_text_map_reader:
[legend]

Data Fields

opentracing_destructible base
 Base class member. More...
 
opentracing_propagation_error_code(* foreach_key )(struct opentracing_text_map_reader *reader, opentracing_propagation_error_code(*handler)(void *arg, const char *key, const char *value), void *arg) OPENTRACINGC_NONNULL(1
 Returns text map contents via repeated calls to the handler function. More...
 
- Data Fields inherited from opentracing_destructible
void(* destroy )(struct opentracing_destructible *destructible) OPENTRACINGC_NONNULL_ALL
 Destructor to clean up any resources allocated to the instance. More...
 

Detailed Description

The extract() carrier for the opentracing_propagation_format_text_map with it, the caller can decode a propagated span context as entries in a map of strings.

Attention
The backing store for the opentracing_text_map_reader may contain data unrelated to span context. As such, inject() and extract() implementations that call the opentracing_text_map_writer and opentracing_text_map_reader interfaces must agree on a prefix or other convention to distinguish their own key:value pairs.

Field Documentation

◆ base

opentracing_destructible opentracing_text_map_reader::base

Base class member.

◆ foreach_key

opentracing_propagation_error_code(* opentracing_text_map_reader::foreach_key) (struct opentracing_text_map_reader *reader, opentracing_propagation_error_code(*handler)(void *arg, const char *key, const char *value), void *arg) OPENTRACINGC_NONNULL(1

Returns text map contents via repeated calls to the handler function.

If any call to handler returns a non-nil error, immediately returns that error. The "foreach" callback pattern reduces unnecessary copying in some cases and also allows implementations to hold locks while the map is read.

Parameters
readerReader instance.
handlerFunction to call for each key:value pair. It should accept a key and a value as arguments and return an error code indicating success or failure.
argUser-defined context argument.
Returns
Error code indicating success or failure.

The documentation for this struct was generated from the following file: