Skip to main content

veilid_tools/resolver/
mod.rs

1use super::*;
2
3/////////////////////////////////////////////////////////////////////////////////
4// Resolver
5//
6// Every lookup goes through the platform's own resolver, so the system's DNS privacy
7// settings (private DNS, encrypted DNS profiles, DoH) apply without veilid knowing about them.
8// veilid never sends a DNS query of its own; the wire codec here only decodes answers.
9
10cfg_if! {
11    if #[cfg(all(target_arch = "wasm32", target_os = "unknown"))] {
12        mod wasm;
13        pub use wasm::*;
14    } else {
15        pub(crate) mod native;
16        pub use native::*;
17    }
18}
19
20/// Error returned by DNS resolution operations.
21#[derive(Debug, Clone, Eq, PartialEq, ThisError)]
22pub enum ResolverError {
23    /// Resolution failed; the string carries a backend-specific description.
24    #[error("Generic resolver error: {0}")]
25    Generic(String),
26    /// This platform has no system resolver for the record type.
27    #[error("Lookup not supported on this platform")]
28    Unsupported,
29}