Available on crate feature
attestation only.Expand description
An HTTP typed header for the graph-attestation header.
The graph-attestation header can contain a JSON-encoded Attestation struct, or an empty
string if no attestation is provided.
§Using the headers::HeaderMapExt extension trait
use headers::HeaderMapExt as _;
use thegraph_headers::graph_attestation::{GraphAttestation, HEADER_NAME};
let mut header_map = http::HeaderMap::new();
// Insert a `graph-attestation` HTTP header
header_map.typed_insert(GraphAttestation(value));
// Get the `graph-attestation` HTTP header by name
let header_by_name = header_map.get(HEADER_NAME);
assert!(header_by_name.is_some());
// Get the `graph-attestation` HTTP header by type
let header_typed = header_map.typed_get::<GraphAttestation>();
assert!(matches!(header_typed, Some(GraphAttestation(..))));Structs§
- Attestation
- An attestation of a request-response pair.
- Graph
Attestation - An HTTP typed header for the
graph-attestationheader.
Constants§
- HEADER_
NAME - The HTTP header name for the
graph-attestationheader.