#![cfg_attr(docsrs, feature(doc_cfg))]
#![allow(
clippy::error_impl_error,
reason = "`Error` is the idiomatic name for the crate's top-level error enum, matching the `thiserror` convention used pervasively in the Rust ecosystem"
)]
#![allow(
clippy::result_large_err,
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"
)]
#![cfg_attr(
test,
allow(
clippy::indexing_slicing,
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"
)
)]
#[cfg(feature = "client")]
#[cfg_attr(docsrs, doc(cfg(feature = "client")))]
mod client;
mod discovery;
mod error;
mod schema;
#[cfg(feature = "client")]
#[cfg_attr(docsrs, doc(cfg(feature = "client")))]
pub use self::client::{
DEFAULT_MAX_BODY_BYTES, fetch, fetch_discovery, fetch_discovery_with_limit, fetch_with_limit,
recommended_client,
};
pub use self::discovery::{Discovery, DiscoveryLink, SCHEMA_REL_PREFIX};
pub use self::error::Error;
pub use self::schema::{
InboundService, NodeInfo, NodeInfoBuilder, OutboundService, Protocol, Services, Software,
Usage, UserCount, Version,
};
pub type Result<T, E = Error> = core::result::Result<T, E>;
pub const WELL_KNOWN_PATH: &str = "/.well-known/nodeinfo";