pub struct WebhookConfig {
pub url: String,
pub method: String,
pub headers: HashMap<String, String>,
pub timeout: Duration,
pub retry_config: RetryConfig,
}Expand description
Webhook configuration
§Example
use reinhardt_tasks::webhook::{WebhookConfig, RetryConfig};
use std::time::Duration;
use std::collections::HashMap;
let mut headers = HashMap::new();
headers.insert("Authorization".to_string(), "Bearer token123".to_string());
let config = WebhookConfig {
url: "https://api.example.com/webhooks".to_string(),
method: "POST".to_string(),
headers,
timeout: Duration::from_secs(5),
retry_config: RetryConfig::default(),
};
assert_eq!(config.url, "https://api.example.com/webhooks");
assert_eq!(config.timeout, Duration::from_secs(5));Fields§
§url: StringWebhook URL
method: StringHTTP method (e.g., “POST”, “PUT”)
headers: HashMap<String, String>Additional HTTP headers
timeout: DurationRequest timeout
retry_config: RetryConfigRetry configuration
Trait Implementations§
Source§impl Clone for WebhookConfig
impl Clone for WebhookConfig
Source§fn clone(&self) -> WebhookConfig
fn clone(&self) -> WebhookConfig
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 moreSource§impl Debug for WebhookConfig
impl Debug for WebhookConfig
Auto Trait Implementations§
impl Freeze for WebhookConfig
impl RefUnwindSafe for WebhookConfig
impl Send for WebhookConfig
impl Sync for WebhookConfig
impl Unpin for WebhookConfig
impl UnsafeUnpin for WebhookConfig
impl UnwindSafe for WebhookConfig
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