pub struct WebhookHook;Expand description
Opt-in request middleware verifying inbound webhook signatures and injecting WebhookEvent.
Trait Implementations§
Source§impl Clone for WebhookHook
impl Clone for WebhookHook
impl Copy for WebhookHook
Source§impl Debug for WebhookHook
impl Debug for WebhookHook
Source§impl Default for WebhookHook
impl Default for WebhookHook
Source§impl ServerHook for WebhookHook
Implements ServerHook for WebhookHook.
impl ServerHook for WebhookHook
Implements ServerHook for WebhookHook.
Source§async fn new(_: &mut Stream, _: &mut Context) -> Self
async fn new(_: &mut Stream, _: &mut Context) -> Self
Constructs a per-request WebhookHook.
§Arguments
&mut Stream- Connection stream.&mut Context- Request context.
§Returns
Self- Hook instance.
Source§async fn handle(self, stream: &mut Stream, ctx: &mut Context) -> Status
async fn handle(self, stream: &mut Stream, ctx: &mut Context) -> Status
Verifies matched inbound webhooks in constant time and short-circuits invalid/replayed requests.
§Arguments
Self- Hook instance.&mut Stream- Connection stream.&mut Context- Request context.
§Returns
Status-Status::Rejectafter sending prebuilt401/409/413wire bytes;Status::Continueotherwise.
Auto Trait Implementations§
impl Forget for WebhookHook
impl Freeze for WebhookHook
impl Move for WebhookHook
impl RefUnwindSafe for WebhookHook
impl Send for WebhookHook
impl Sync for WebhookHook
impl Unpin for WebhookHook
impl UnsafeUnpin for WebhookHook
impl UnwindSafe for WebhookHook
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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