Expand description
§Hookburn Core
Shared types and traits for the hookburn webhook ecosystem.
This crate provides the foundation for building webhook clients that work with multiple services (Discord, Slack, Teams, etc.). It defines common interfaces, message types, and utilities that service crates can implement.
§Features
- Unified API: Send messages to any webhook service through a common trait
- Generic Messages: Service-agnostic message types with conversion support
- Service Registry: Discover and create webhook clients dynamically
- Retry Policies: Automatic retries with exponential backoff and jitter
- HTTP Client: Configurable HTTP client with timeout support
§Example
use hookburn_core::{WebhookSender, GenericMessage, WebhookService};
// Create a service-specific sender (e.g., Discord)
// let sender = ...;
// Send a generic message
let msg = GenericMessage::new("Hello from Hookburn!")
.with_username("MyBot");
// sender.send(&msg).await?;§Crate Organization
| Module | Purpose |
|---|---|
builder | HTTP client builder with configurable timeouts |
client | HTTP client wrapper with retry support |
error | Common error types for all services |
message | Generic message types and conversion trait |
registry | Service discovery and registration |
retry | Retry policies with exponential backoff |
sender | Core WebhookSender trait for all services |
service | Service metadata and builder trait |
webhook_service | Generic service wrapper for easy usage |
Re-exports§
pub use builder::HttpClientBuilder;pub use client::HttpClient;pub use error::CoreError;pub use message::GenericEmbed;pub use message::GenericMessage;pub use message::MessageConverter;pub use registry::WebhookRegistry;pub use retry::RetryPolicy;pub use sender::WebhookSender;pub use service::Platform;pub use service::ServiceBuilder;pub use service::ServiceConfig;pub use service::ServiceInfo;pub use webhook_service::BoxedWebhookSender;pub use webhook_service::WebhookService;
Modules§
- builder
- HTTP client builder with configurable timeouts.
- client
- HTTP client with retry support and timeout handling.
- error
- Common error types for the hookburn ecosystem.
- message
- Service-agnostic message types and conversion traits.
- registry
- Service registry for discovering and creating webhook clients.
- retry
- Retry policies with exponential backoff and jitter.
- sender
- Core
WebhookSendertrait implemented by all services. - service
- Service metadata and builder traits for service creation.
- webhook_
service - Generic webhook service wrapper implementation.