Skip to main content

Module wiring

Module wiring 

Source
Expand description

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(...).

Functions§

default_policy_stack
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.
policy_stack_from
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 = [...]).
read_wiring
Read the ClientWiring for a single provided contract from the module’s config section.