dpp_digital_link/linktype/mod.rs
1//! GS1 Digital Link link-type negotiation.
2//!
3//! When a resolver receives a Digital Link request, the client can specify
4//! which representation it wants via:
5//! - Query parameter: `?linkType=gs1:epil` (product information page)
6//! - HTTP Accept header: `application/json`, `application/ld+json`, etc.
7//!
8//! The ESPR mandates that DPP data is resolvable through GS1 Digital Link.
9//! Different consumers need different representations:
10//! - A consumer scanning a QR code wants an HTML product page.
11//! - A machine client wants JSON-LD or raw DPP JSON.
12//! - A market surveillance authority wants the full signed DPP payload.
13//!
14//! ## Module layout
15//!
16//! - `vocabulary` — [`Gs1LinkType`], the GS1 Web Vocabulary link types.
17//! - `media_type` — [`DppMediaType`] for content negotiation.
18//! - `request` — [`ResolutionRequest`] + HTTP `Accept`-header parsing.
19//! - [`negotiate`](negotiate()) — [`LinkDescriptor`] + the negotiation algorithm.
20
21mod media_type;
22mod negotiate;
23mod request;
24#[cfg(test)]
25mod tests;
26mod vocabulary;
27
28/// Re-export the canonical access vocabulary from dpp-domain.
29pub use dpp_domain::{Audience, Disclosure};
30pub use media_type::DppMediaType;
31pub use negotiate::{LinkDescriptor, negotiate};
32pub use request::ResolutionRequest;
33pub use vocabulary::Gs1LinkType;