Skip to main content

Module qdp_server

Module qdp_server 

Source
Expand description

QDP profile renderer — HTTP content-negotiation for the /.well-known/QDP profile.

This module is pure: it turns a crate::front_door::FrontDoorRecord plus an HTTP Accept header value into a QdpResponse (content-type + body bytes). It does not bind a socket, spawn a listener, or perform any I/O — the transport layer (daemon, Worker, Solid POD) owns the socket and calls render_profile to produce the payload for the matched route.

Content negotiation follows QDP §3.1 (the rich profile is served in Turtle + JSON-LD + CBOR-LD):

  • application/ld+json → JSON-LD (to_json_ld)
  • application/cbor → CBOR-LD (to_cbor_ld)
  • anything else, incl. text/turtle and */* → Turtle (to_turtle, the default)

Structs§

QdpResponse
A rendered QDP profile response: the negotiated content type and the serialized body bytes.

Constants§

WELL_KNOWN_QDP_PATH
The well-known path the rich QDP profile is served at (QDP §3.1).

Functions§

render_profile
Render a FrontDoorRecord as a QDP profile, negotiating the representation from an HTTP Accept header value.