Expand description
NodeInfo server metadata protocol for the Fediverse.
Implements NodeInfo 2.0 / 2.1 and FEP-0151 (NodeInfo 2025 edition),
providing both discovery (/.well-known/nodeinfo) and schema documents.
§Example (server)
use actpub_nodeinfo::{NodeInfo, Software, Usage, UserCount, Protocol, Version};
let info = NodeInfo::builder(Version::V2_1, Software::new("my-server", "1.0.0"))
.protocol(Protocol::ActivityPub)
.open_registrations(true)
.usage(Usage::new(UserCount::default().with_total(42)))
.build();
let json = serde_json::to_string(&info).unwrap();
assert!(json.contains(r#""version":"2.1""#));Structs§
- Discovery
- A
NodeInfodiscovery document, served at/.well-known/nodeinfo. - Discovery
Link - A single discovery link pointing at a specific schema version.
- Node
Info - A
NodeInfo2.0 / 2.1 document. - Node
Info Builder - Builder for
NodeInfoproduced byNodeInfo::builder. - Services
- Set of inbound/outbound bridge services.
- Software
- Metadata about the software powering a server.
- Usage
- Aggregate server usage statistics.
- User
Count - Per-user activity counts.
Enums§
- Error
- All failure modes for this crate.
- Inbound
Service - An inbound bridge service defined in
NodeInfo. - Outbound
Service - An outbound bridge service defined in
NodeInfo. - Protocol
- A federation protocol supported by a NodeInfo-described server.
- Version
- The
NodeInfoschema version this document conforms to.
Constants§
- DEFAULT_
MAX_ BODY_ BYTES client - Default hard cap on the response body we will read from a
NodeInfoendpoint. - SCHEMA_
REL_ PREFIX - Common prefix shared by all
NodeInfoschemarelURIs. - WELL_
KNOWN_ PATH - The well-known URI path for the
NodeInfodiscovery document.
Functions§
- fetch
client - Fetches a
NodeInfodocument atversionfromhost. - fetch_
discovery client - Fetches the
/.well-known/nodeinfodiscovery document fromhost, enforcingDEFAULT_MAX_BODY_BYTESas the body size cap. - fetch_
discovery_ with_ limit client fetch_discoveryvariant accepting an explicit body size cap.- fetch_
with_ limit client fetchvariant accepting an explicit body size cap.- recommended_
client client - Builds a
reqwest::Clientpre-configured for safeNodeInforesolution.