-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathNoOpInstrument.swift
32 lines (28 loc) · 1.02 KB
/
NoOpInstrument.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift Distributed Tracing open source project
//
// Copyright (c) 2020-2022 Apple Inc. and the Swift Distributed Tracing project
// authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import InstrumentationBaggage
/// A "no op" implementation of an ``InstrumentProtocol``.
public struct NoOpInstrument: InstrumentProtocol {
public init() {}
public func inject<Carrier, Inject>(_ baggage: Baggage, into carrier: inout Carrier, using injector: Inject)
where Inject: Injector, Carrier == Inject.Carrier
{
// no-op
}
public func extract<Carrier, Extract>(_ carrier: Carrier, into baggage: inout Baggage, using extractor: Extract)
where Extract: Extractor, Carrier == Extract.Carrier
{
// no-op
}
}