struct
OpenTelemetry::Trace::TraceState
- OpenTelemetry::Trace::TraceState
- Struct
- Value
- Object
Overview
An ordered collection of validated W3C tracestate members. Concurrency: immutable and safe to share.
Included Modules
- Enumerable({String, String})
Defined in:
api/trace/trace_state.crConstant Summary
-
EMPTY =
new([] of ::Tuple(String, String)) -
MAX_MEMBERS =
32
Constructors
-
.parse(header : String) : TraceState
Parses a W3C Trace Context Level 2 header.
Instance Method Summary
- #==(other : self)
- #[]?(key : String) : String | Nil
- #delete(key : String) : TraceState
-
#each(& : Tuple(String, String) -> ) : Nil
Must yield this collection's elements to the block.
-
#empty? : Bool
Returns
trueifselfdoes not contain any element. -
#hash(hasher)
See
Object#hash(hasher) -
#set(key : String, value : String) : TraceState
Places a member first, removing the rightmost member if necessary.
-
#size : Int32
Returns the number of elements in the collection.
- #to_header : String
Constructor Detail
def self.parse(header : String) : TraceState
#
Parses a W3C Trace Context Level 2 header. Invalid headers yield an empty state.
Instance Method Detail
def each(& : Tuple(String, String) -> ) : Nil
#
Description copied from module Enumerable({String, String})
Must yield this collection's elements to the block.
def empty? : Bool
#
Description copied from module Enumerable({String, String})
Returns true if self does not contain any element.
([] of Int32).empty? # => true
([1]).empty? # => false
[nil, false].empty? # => false
#present?returns the inverse.
def set(key : String, value : String) : TraceState
#
Places a member first, removing the rightmost member if necessary.
def size : Int32
#
Description copied from module Enumerable({String, String})
Returns the number of elements in the collection.
[1, 2, 3, 4].size # => 4