Skip to main content

r402_core/
lib.rs

1#![cfg_attr(docsrs, feature(doc_cfg))]
2#![doc = include_str!("../README.md")]
3// Tests exercise serde_json values via `value["key"]` indexing which is the
4// idiomatic way to write assertions; the panic-on-missing-key behaviour is
5// desirable there. Production code never uses `IndexMut` on arbitrary JSON.
6#![cfg_attr(
7    test,
8    allow(
9        clippy::indexing_slicing,
10        clippy::panic,
11        reason = "tests rely on panic-on-failure for simpler assertions"
12    )
13)]
14
15// These crates are re-exported behind feature flags and consumed indirectly
16// by tracing macros / telemetry instrumentation; the linter cannot see those
17// references, so we suppress the unused-crate warning.
18#[cfg(feature = "telemetry")]
19use tracing as _;
20#[cfg(feature = "telemetry")]
21use tracing_core as _;
22
23pub mod amount;
24pub mod chain;
25pub mod error;
26pub mod error_reason;
27pub mod extensions;
28pub mod facilitator;
29pub mod hooks;
30pub mod payment;
31pub mod resource_server;
32pub mod scheme;
33pub mod wire;
34
35pub use resource_server::{ResourceServer, WirePaymentPayload};
36
37#[cfg(feature = "cache")]
38#[cfg_attr(docsrs, doc(cfg(feature = "cache")))]
39pub mod cache;
40
41#[cfg(feature = "metrics")]
42#[cfg_attr(docsrs, doc(cfg(feature = "metrics")))]
43pub mod metrics;
44
45// `proptest` is consumed by integration tests under `tests/`, but the
46// lib's own test target also links every dev-dep and would otherwise
47// trip `unused_crate_dependencies` because no unit test references it.
48// The empty re-import silences that lint without affecting binary size.
49pub use error::{ClientError, FacilitatorError, SettlementError, VerificationError};
50pub use error_reason::{AsPaymentProblem, ErrorReason, PaymentProblem};
51pub use facilitator::{BoxFuture, DynFacilitator, Facilitator};
52pub use hooks::{
53    DynFacilitatorHooks, FacilitatorHooks, FailureRecovery, HookDecision, HookedFacilitator,
54    SettleContext as HookSettleContext, VerifyContext as HookVerifyContext,
55};
56#[cfg(test)]
57use proptest as _;