pub struct WebhookRegistry { /* private fields */ }Expand description
Manages webhook subscriptions in-memory using DashMap
Implementations§
Source§impl WebhookRegistry
impl WebhookRegistry
pub fn new() -> Self
Sourcepub fn register(&self, req: RegisterWebhookRequest) -> WebhookSubscription
pub fn register(&self, req: RegisterWebhookRequest) -> WebhookSubscription
Register a new webhook subscription
Sourcepub fn get(&self, id: Uuid) -> Option<WebhookSubscription>
pub fn get(&self, id: Uuid) -> Option<WebhookSubscription>
Get a webhook by ID
Sourcepub fn list_by_tenant(&self, tenant_id: &str) -> Vec<WebhookSubscription>
pub fn list_by_tenant(&self, tenant_id: &str) -> Vec<WebhookSubscription>
List webhooks for a tenant
Sourcepub fn update(
&self,
id: Uuid,
req: UpdateWebhookRequest,
) -> Option<WebhookSubscription>
pub fn update( &self, id: Uuid, req: UpdateWebhookRequest, ) -> Option<WebhookSubscription>
Update a webhook
Sourcepub fn delete(&self, id: Uuid) -> Option<WebhookSubscription>
pub fn delete(&self, id: Uuid) -> Option<WebhookSubscription>
Delete a webhook
Sourcepub fn find_matching(&self, event: &Event) -> Vec<WebhookSubscription>
pub fn find_matching(&self, event: &Event) -> Vec<WebhookSubscription>
Find all active webhooks that match a given event
Sourcepub fn record_delivery(&self, delivery: WebhookDelivery)
pub fn record_delivery(&self, delivery: WebhookDelivery)
Record a delivery attempt
Sourcepub fn get_deliveries(
&self,
webhook_id: Uuid,
limit: usize,
) -> Vec<WebhookDelivery>
pub fn get_deliveries( &self, webhook_id: Uuid, limit: usize, ) -> Vec<WebhookDelivery>
Get delivery history for a webhook
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WebhookRegistry
impl !RefUnwindSafe for WebhookRegistry
impl Send for WebhookRegistry
impl Sync for WebhookRegistry
impl Unpin for WebhookRegistry
impl UnsafeUnpin for WebhookRegistry
impl UnwindSafe for WebhookRegistry
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more