pub struct WebhookTriggerRegistry {
pub triggers: Vec<WebhookTrigger>,
}Expand description
In-process registry that matches incoming WebhookPayloads to registered
WebhookTriggers.
Fields§
§triggers: Vec<WebhookTrigger>All registered triggers, in insertion order.
Implementations§
Source§impl WebhookTriggerRegistry
impl WebhookTriggerRegistry
Sourcepub fn add_trigger(&mut self, trigger: WebhookTrigger)
pub fn add_trigger(&mut self, trigger: WebhookTrigger)
Register a new trigger. If a trigger with the same id already exists
it is replaced.
Sourcepub fn remove_trigger(&mut self, id: &str) -> Option<WebhookTrigger>
pub fn remove_trigger(&mut self, id: &str) -> Option<WebhookTrigger>
Remove the trigger with the given id, returning it if present.
Sourcepub fn match_trigger(&self, payload: &WebhookPayload) -> Option<&WebhookTrigger>
pub fn match_trigger(&self, payload: &WebhookPayload) -> Option<&WebhookTrigger>
Return the first trigger whose path exactly matches
payload.path.
If the matching trigger has a secret_token, the X-Signature header
of the payload is also validated via validate_signature. A trigger
whose signature check fails is skipped (the next matching trigger is
tried instead).
Trait Implementations§
Source§impl Debug for WebhookTriggerRegistry
impl Debug for WebhookTriggerRegistry
Source§impl Default for WebhookTriggerRegistry
impl Default for WebhookTriggerRegistry
Source§fn default() -> WebhookTriggerRegistry
fn default() -> WebhookTriggerRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WebhookTriggerRegistry
impl RefUnwindSafe for WebhookTriggerRegistry
impl Send for WebhookTriggerRegistry
impl Sync for WebhookTriggerRegistry
impl Unpin for WebhookTriggerRegistry
impl UnsafeUnpin for WebhookTriggerRegistry
impl UnwindSafe for WebhookTriggerRegistry
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