pub struct ResolverConfig {
pub domain: String,
pub nameserver: String,
pub port: u16,
pub search_order: u32,
}Expand description
Configuration for a single /etc/resolver/<domain> entry.
§Example
use macos_resolver::ResolverConfig;
let config = ResolverConfig::new("myapp.local", "127.0.0.1", 5553)
.with_search_order(10);
assert_eq!(config.domain, "myapp.local");
assert_eq!(config.port, 5553);
assert_eq!(config.search_order, 10);Fields§
§domain: StringDomain suffix (e.g., "myapp.local").
Becomes the filename under /etc/resolver/.
nameserver: StringNameserver IP address (e.g., "127.0.0.1").
port: u16DNS port. Standard DNS uses 53; custom resolvers typically use a high port (e.g., 5553) to avoid conflicts.
search_order: u32Search order — lower values are tried first.
Implementations§
Trait Implementations§
Source§impl Clone for ResolverConfig
impl Clone for ResolverConfig
Source§fn clone(&self) -> ResolverConfig
fn clone(&self) -> ResolverConfig
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 moreAuto Trait Implementations§
impl Freeze for ResolverConfig
impl RefUnwindSafe for ResolverConfig
impl Send for ResolverConfig
impl Sync for ResolverConfig
impl Unpin for ResolverConfig
impl UnsafeUnpin for ResolverConfig
impl UnwindSafe for ResolverConfig
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