Skip to main content

delivery_id

Function delivery_id 

Source
pub fn delivery_id(headers: &HeaderMap) -> Option<&str>
Expand description

Reads the delivery id from a webhook request’s headers (DELIVERY_ID_HEADER).

None when the header is absent, is not visible ASCII, or appears more than once with different values.

use a2a_protocol_server::push::webhook::delivery_id;

let mut headers = hyper::HeaderMap::new();
headers.insert("A2A-Delivery-Id", "0b7e".parse().unwrap());
assert_eq!(delivery_id(&headers), Some("0b7e"));