Skip to main content

Crate actpub_nodeinfo

Crate actpub_nodeinfo 

Source
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 NodeInfo discovery document, served at /.well-known/nodeinfo.
DiscoveryLink
A single discovery link pointing at a specific schema version.
NodeInfo
A NodeInfo 2.0 / 2.1 document.
NodeInfoBuilder
Builder for NodeInfo produced by NodeInfo::builder.
Services
Set of inbound/outbound bridge services.
Software
Metadata about the software powering a server.
Usage
Aggregate server usage statistics.
UserCount
Per-user activity counts.

Enums§

Error
All failure modes for this crate.
InboundService
An inbound bridge service defined in NodeInfo.
OutboundService
An outbound bridge service defined in NodeInfo.
Protocol
A federation protocol supported by a NodeInfo-described server.
Version
The NodeInfo schema version this document conforms to.

Constants§

DEFAULT_MAX_BODY_BYTESclient
Default hard cap on the response body we will read from a NodeInfo endpoint.
SCHEMA_REL_PREFIX
Common prefix shared by all NodeInfo schema rel URIs.
WELL_KNOWN_PATH
The well-known URI path for the NodeInfo discovery document.

Functions§

fetchclient
Fetches a NodeInfo document at version from host.
fetch_discoveryclient
Fetches the /.well-known/nodeinfo discovery document from host, enforcing DEFAULT_MAX_BODY_BYTES as the body size cap.
fetch_discovery_with_limitclient
fetch_discovery variant accepting an explicit body size cap.
fetch_with_limitclient
fetch variant accepting an explicit body size cap.
recommended_clientclient
Builds a reqwest::Client pre-configured for safe NodeInfo resolution.

Type Aliases§

Result
Crate Result alias with the default error type set to Error.