use rsip::{Domain, Error}; use rsip_dns::{records::*, DnsClient}; #[derive(Debug, Clone, Default)] pub struct MockedDnsClient { pub naptr_record: Option, pub srv_record: Option, pub a_record: Option, pub aaaa_record: Option, } #[async_trait::async_trait] impl DnsClient for MockedDnsClient { async fn naptr_lookup(&self, _domain: Domain) -> Option { self.naptr_record.clone() } async fn srv_lookup(&self, _domain: SrvDomain) -> Option { self.srv_record.clone() } async fn ip_lookup(&self, _domain: Domain) -> Result { Ok(self.a_record.clone().unwrap()) } }