pub struct SharedWebhook(/* private fields */);Expand description
A thread-safe wrapper around Webhook to make it shareable between Axum handlers.
This type provides a convenient way to share the webhook verifier across multiple
request handlers without needing to clone the underlying Webhook for each request.
Implementations§
Sourcepub fn new(webhook: Webhook) -> Self
pub fn new(webhook: Webhook) -> Self
Creates a new SharedWebhook from a Webhook
for use during verification.
§Arguments
webhook- TheWebhookto wrap
§Returns
A new SharedWebhook wrapping the provided Webhook
§Example
use axum_standardwebhooks::{SharedWebhook, Webhook};
let shared_webhook = SharedWebhook::new(Webhook::new("whsec_C2FVsBQIhrscChlQIMV+b5sSYspob7oD").unwrap());Trait Implementations§
Source§fn clone(&self) -> SharedWebhook
fn clone(&self) -> SharedWebhook
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
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