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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
//! `NoOpStateful` test capability.
//!
//! A reference capability that carries per-instance mutable state,
//! intended for end-to-end tests that need to verify the extension
//! wiring respects `&mut self` correctly (both natively and through
//! the `SharedAsLocal` adapter), and that per-consumer instance
//! isolation works as advertised.
//!
//! Together with [`NoOpStateless`](super::no_op_stateless::NoOpStateless)
//! these two capabilities cover the matrix of receiver shapes
//! (`&self` / `&mut self`), method modes (sync / async), and argument
//! / return shapes that the `#[capability]` proc macro must support.
//!
//! The `#[capability]` proc macro expands the trait below into:
//!
//! - A `pub(crate) mod local` containing the `!Send` `NoOpStateful` trait variant
//! - A `pub(crate) mod shared` containing the `Send + Sync` `NoOpStateful` trait variant
//! - A `SharedAsLocalNoOpStateful` adapter (auto-delegates `&mut self`)
//! - A zero-sized `pub struct NoOpStateful` registration handle
//! - `local_entry::<E>` / `shared_entry::<E>` factory bridges
//! - A `KNOWN_CAPABILITIES` distributed-slice entry
use capability;
/// No-op test capability with per-instance mutable state.
///
/// Reference implementations track simple counters / last-recorded
/// values so tests can assert that mutations on one consumer's
/// instance do not leak into another's (per-consumer `Box`-clone
/// ownership semantics).
// The `#[capability]` macro emits the `local`/`shared` trait modules as
// `pub(crate)`, so downstream test crates reach the variants through these
// public aliases (a single surface) rather than the private submodule paths.
/// The `!Send` (local) variant of the [`NoOpStateful`] capability trait.
pub use NoOpStateful as LocalNoOpStateful;
/// The `Send + Sync` (shared) variant of the [`NoOpStateful`] capability trait.
pub use NoOpStateful as SharedNoOpStateful;