Module graph_attestable

Module graph_attestable 

Source
Expand description

An HTTP typed header for the graph-attestable header.

This HTTP header is used to indicate whether a response is attestable or not.

§Using the headers::HeaderMapExt extension trait

use headers::HeaderMapExt as _;
use thegraph_headers::graph_attestable::{GraphAttestable, HEADER_NAME};

let mut header_map = http::HeaderMap::new();

// Insert a `graph-attestable` HTTP header
header_map.typed_insert(GraphAttestable(value));

// Get the `graph-attestable` HTTP header by name
let header_by_name = header_map.get(HEADER_NAME);
assert!(header_by_name.is_some());

// Get the `graph-attestable` HTTP header by type
let header_typed = header_map.typed_get::<GraphAttestable>();
assert!(matches!(header_typed, Some(GraphAttestable(..))));

Structs§

GraphAttestable
An HTTP typed header for the graph-attestable header.

Constants§

HEADER_NAME
The HTTP header name for the graph-attestable header.