1#![cfg_attr(docsrs, feature(doc_cfg))]
25#![allow(
26 clippy::error_impl_error,
27 reason = "`Error` is the idiomatic name for the crate's top-level error enum, matching the `thiserror` convention used pervasively in the Rust ecosystem"
28)]
29#![allow(
30 clippy::result_large_err,
31 reason = "The `CrossOriginHref` variant carries two `Url`s (discovery + attacker-supplied) so operators can triage SSRF-pivot attempts from logs; boxing the whole enum would complicate every happy path for no measurable cost on the always-cold error path"
32)]
33#![cfg_attr(
34 test,
35 allow(
36 clippy::indexing_slicing,
37 reason = "JSON field indexing via `Value[\"key\"]` is ergonomic inside tests and its panic-on-missing behaviour is the desired failure mode when fixtures are wrong"
38 )
39)]
40
41#[cfg(feature = "client")]
42#[cfg_attr(docsrs, doc(cfg(feature = "client")))]
43mod client;
44mod discovery;
45mod error;
46mod schema;
47
48#[cfg(feature = "client")]
49#[cfg_attr(docsrs, doc(cfg(feature = "client")))]
50pub use self::client::{
51 DEFAULT_MAX_BODY_BYTES, fetch, fetch_discovery, fetch_discovery_with_limit, fetch_with_limit,
52 recommended_client,
53};
54pub use self::discovery::{Discovery, DiscoveryLink, SCHEMA_REL_PREFIX};
55pub use self::error::Error;
56pub use self::schema::{
57 InboundService, NodeInfo, NodeInfoBuilder, OutboundService, Protocol, Services, Software,
58 Usage, UserCount, Version,
59};
60
61pub type Result<T, E = Error> = core::result::Result<T, E>;
63
64pub const WELL_KNOWN_PATH: &str = "/.well-known/nodeinfo";