pub struct ValidatedConfig {Show 13 fields
pub ip_version: IpVersion,
pub change_kind: ChangeKind,
pub url: Url,
pub method: Method,
pub headers: HeaderMap,
pub body_template: Option<String>,
pub filter: FilterChain,
pub poll_interval: Duration,
pub poll_only: bool,
pub retry_policy: RetryPolicy,
pub state_file: Option<PathBuf>,
pub dry_run: bool,
pub verbose: bool,
}Expand description
Fully validated configuration ready for use by the application.
This struct represents a complete, validated configuration where all required fields are present and all values have been validated.
§Construction
Use ValidatedConfig::from_raw to create from CLI args and optional TOML config.
The function validates all inputs and returns errors for invalid configurations.
Fields§
§ip_version: IpVersionIP version to monitor (required)
change_kind: ChangeKindChange kind filter (Added/Removed/Both)
url: UrlWebhook URL (required)
method: MethodHTTP method for webhook requests
headers: HeaderMapHTTP headers for webhook requests
body_template: Option<String>Handlebars body template (optional)
filter: FilterChainAdapter filter configuration
poll_interval: DurationPolling interval
poll_only: boolWhether to use polling only (no API events)
retry_policy: RetryPolicyRetry policy for failed webhook requests
state_file: Option<PathBuf>Path to state file for detecting changes across restarts.
If None, state persistence is disabled.
dry_run: boolDry-run mode (log changes without sending webhooks)
verbose: boolVerbose logging enabled
Implementations§
Source§impl ValidatedConfig
impl ValidatedConfig
Sourcepub fn from_raw(
cli: &Cli,
toml: Option<&TomlConfig>,
) -> Result<Self, ConfigError>
pub fn from_raw( cli: &Cli, toml: Option<&TomlConfig>, ) -> Result<Self, ConfigError>
Creates a validated configuration from CLI arguments and optional TOML config.
CLI arguments take precedence over TOML config values.
§Errors
Returns an error if:
- Required fields are missing (
url,ip_version) - URL is invalid
- Regex patterns are invalid
- Duration values are zero
- Header format is invalid
Trait Implementations§
Source§impl Debug for ValidatedConfig
impl Debug for ValidatedConfig
Auto Trait Implementations§
impl Freeze for ValidatedConfig
impl !RefUnwindSafe for ValidatedConfig
impl Send for ValidatedConfig
impl Sync for ValidatedConfig
impl Unpin for ValidatedConfig
impl !UnwindSafe for ValidatedConfig
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
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.