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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
//! Trait and types for local (!Send) extensions.
use crateExtensionControlMsg;
use crateError;
use crateEffectHandler;
use crateLocalReceiver;
use crateTerminalState;
use async_trait;
use Rc;
/// Local (!Send) control channel for extensions.
///
/// Wraps a [`LocalReceiver`] with shutdown-grace-period logic.
/// See [`crate::extension::ControlChannel`] for the implementation.
pub type ControlChannel = crateControlChannel;
/// A trait for extensions (!Send variant).
///
/// Extensions are long-lived components hosted alongside the data path --
/// today at pipeline scope, and in the future at engine, pipeline-group,
/// or node scope -- that expose functionality (e.g., authentication,
/// service discovery) to other components.
///
/// Unlike receivers, processors, and exporters, extensions are NOT generic
/// over PData -- they never process PData.
///
/// # Thread Safety
///
/// The local `Extension` trait does NOT require the `Send` bound, allowing
/// use of `Rc`, `RefCell`, and other !Send types within a single-threaded
/// `LocalSet`.
///
/// # Ownership
///
/// `start` takes `Rc<Self>` so the same instance can serve both the background
/// task and capability consumers without cloning internal state.