class Traces::Context

def inject(headers)

@returns [Hash] The modified headers hash.

@parameter headers [Hash] The headers hash to inject the trace context into.

Inject the trace context into the headers, including the `"traceparent"`, `"tracestate"`, and `"baggage"` headers.
def inject(headers)
	headers["traceparent"] = self.to_s
	
	if @state and !@state.empty?
		headers["tracestate"] = self.state.map{|key, value| "#{key}=#{value}"}.join(",")
	end
	
	if @baggage and !@baggage.empty?
		headers["baggage"] = self.baggage.map{|key, value| "#{key}=#{value}"}.join(",")
	end
	
	return headers
end