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
//! Runtime helpers consumed by `#[toolkit::provides]`.
//!
//! Kept separate from the proc-macro crate so the generated code references
//! stable, version-controlled host APIs rather than re-importing them from
//! `toolkit_contract`. Provider gears don't import these directly — the
//! macro emits paths like `::toolkit::wiring::read_wiring(...)`.
use Arc;
use ;
use ClientWiring;
use crateGearCtx;
/// Read the [`ClientWiring`] for a single provided contract.
///
/// Path: `gears.<gear>.clients.provides.<key>`, with `clients.defaults`
/// merged under it ([`crate::clients_config::provided_wiring`]). If the entry
/// is absent, returns [`ClientWiring::Local`] — gears whose only provided
/// contract has a local-only deployment can run with no config at all.
///
/// `key` is the `snake_case` form of the contract trait identifier (e.g.
/// `payment_api` for `PaymentApi`); the macro takes care of casing.
///
/// # Errors
/// Returns an `anyhow::Error` naming the config path if the entry is present
/// but malformed.
/// Default [`PolicyStack`] applied to in-process local clients built by
/// `#[toolkit::provides]`. Contains [`TracingPolicy`] only; richer stacks
/// can be opted into via the `policies = [...]` macro argument.
/// Build a [`PolicyStack`] from a list of already-constructed policy
/// instances (the macro emits `Box::new(Policy::default())` per entry
/// when the user passes `policies = [...]`).