pub struct WebhookPayload {
pub headers: HashMap<String, String>,
pub body: Vec<u8>,
pub timestamp: u64,
pub path: String,
}Expand description
An inbound HTTP POST payload received by the webhook trigger server.
Fields§
§headers: HashMap<String, String>HTTP headers as lowercase-key map.
body: Vec<u8>Raw request body bytes.
timestamp: u64Unix timestamp (milliseconds) at which the request was received.
path: StringURL path of the request (e.g. "/webhooks/ingest-ready").
Implementations§
Source§impl WebhookPayload
impl WebhookPayload
Sourcepub fn new(
path: impl Into<String>,
headers: HashMap<String, String>,
body: Vec<u8>,
timestamp: u64,
) -> Self
pub fn new( path: impl Into<String>, headers: HashMap<String, String>, body: Vec<u8>, timestamp: u64, ) -> Self
Create a new WebhookPayload.
Sourcepub fn header(&self, key: &str) -> Option<&str>
pub fn header(&self, key: &str) -> Option<&str>
Look up a header value using a case-insensitive key.
Returns None if the header is absent.
Trait Implementations§
Source§impl Clone for WebhookPayload
impl Clone for WebhookPayload
Source§fn clone(&self) -> WebhookPayload
fn clone(&self) -> WebhookPayload
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WebhookPayload
impl RefUnwindSafe for WebhookPayload
impl Send for WebhookPayload
impl Sync for WebhookPayload
impl Unpin for WebhookPayload
impl UnsafeUnpin for WebhookPayload
impl UnwindSafe for WebhookPayload
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more