pub struct DnsConfig {
pub pre_connection: DohServerConfig,
pub post_connection: DohServerConfig,
}Expand description
DNS configuration for the library.
Allows configuring different DNS servers for pre-connection (direct mode) and post-connection (tunnel mode) DNS resolution.
Fields§
§pre_connection: DohServerConfigDNS server to use before the WireGuard tunnel is established. This is used to resolve the WireGuard endpoint hostname.
post_connection: DohServerConfigDNS server to use after the WireGuard tunnel is established. All DNS queries will go through the VPN tunnel.
Implementations§
Source§impl DnsConfig
impl DnsConfig
Sourcepub fn new(server: DohServerConfig) -> Self
pub fn new(server: DohServerConfig) -> Self
Create a new DNS configuration with the same server for both modes.
Sourcepub fn with_different_servers(
pre_connection: DohServerConfig,
post_connection: DohServerConfig,
) -> Self
pub fn with_different_servers( pre_connection: DohServerConfig, post_connection: DohServerConfig, ) -> Self
Create a DNS configuration with different servers for pre and post connection.
Sourcepub fn cloudflare() -> Self
pub fn cloudflare() -> Self
Use Cloudflare DNS for both modes (default).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DnsConfig
impl RefUnwindSafe for DnsConfig
impl Send for DnsConfig
impl Sync for DnsConfig
impl Unpin for DnsConfig
impl UnwindSafe for DnsConfig
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more