pub struct SimbadConfig {
pub endpoint: String,
pub timeout: Duration,
pub user_agent: String,
}Expand description
Configuration for a network-backed crate::Resolver (e.g. the SIMBAD TAP
or Sesame resolver).
Fields§
§endpoint: StringBackend endpoint URL (validated by the resolver via url; https, or
http loopback for local testing).
timeout: DurationPer-request timeout; on expiry the resolver returns
crate::ResolveError::Timeout so callers degrade to seed+cache.
user_agent: StringIdentifying User-Agent header value.
Implementations§
Source§impl SimbadConfig
impl SimbadConfig
Sourcepub fn from_settings(endpoint: impl Into<String>, timeout_secs: u64) -> Self
pub fn from_settings(endpoint: impl Into<String>, timeout_secs: u64) -> Self
Build a config from caller-persisted settings, clamping timeout_secs
to a minimum of 1 second (a 0s timeout would fail every request).
use std::time::Duration;
use simbad_resolver::SimbadConfig;
let config = SimbadConfig::from_settings("https://example.test/tap", 0);
assert_eq!(config.timeout, Duration::from_secs(1), "0s is clamped to 1s");Trait Implementations§
Source§impl Clone for SimbadConfig
impl Clone for SimbadConfig
Source§impl Debug for SimbadConfig
impl Debug for SimbadConfig
Auto Trait Implementations§
impl Freeze for SimbadConfig
impl RefUnwindSafe for SimbadConfig
impl Send for SimbadConfig
impl Sync for SimbadConfig
impl Unpin for SimbadConfig
impl UnsafeUnpin for SimbadConfig
impl UnwindSafe for SimbadConfig
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