1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// crates/hookburn-core/src/lib.rs
//! # 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
//!
//! ```rust,no_run
//! 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?;
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
//!
//! # 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 |
/// HTTP client builder with configurable timeouts.
/// HTTP client with retry support and timeout handling.
/// Common error types for the hookburn ecosystem.
/// Service-agnostic message types and conversion traits.
/// Service registry for discovering and creating webhook clients.
/// Retry policies with exponential backoff and jitter.
/// Core `WebhookSender` trait implemented by all services.
/// Service metadata and builder traits for service creation.
/// Generic webhook service wrapper implementation.
// Re-exports
/// HTTP client builder for configuring timeouts and connection settings.
pub use HttpClientBuilder;
/// HTTP client with retry support and shared connection pool.
pub use HttpClient;
/// Common error type used across all hookburn services.
pub use CoreError;
/// Generic message types for service-agnostic webhook sending.
pub use ;
/// Service registry for discovering and creating webhook clients.
pub use WebhookRegistry;
/// Retry policy with exponential backoff and optional jitter.
pub use RetryPolicy;
/// Core trait for sending webhook messages to any service.
pub use WebhookSender;
/// Service metadata, configuration, and builder traits.
pub use ;
/// Generic webhook service wrapper that sends `GenericMessage`.
pub use ;