pub struct DnsPkarrServer {
pub node_origin: String,
pub nameserver: SocketAddr,
pub pkarr_url: Url,
/* private fields */
}
Available on
test
or crate feature test-utils
only.Expand description
Handle and drop guard for test DNS and Pkarr servers.
Once the struct is dropped the servers will shut down.
Fields§
§node_origin: String
The node origin domain.
nameserver: SocketAddr
The socket address of the DNS server.
pkarr_url: Url
The HTTP URL of the Pkarr server.
Implementations§
Source§impl DnsPkarrServer
impl DnsPkarrServer
Sourcepub async fn run_with_origin(node_origin: String) -> Result<Self>
pub async fn run_with_origin(node_origin: String) -> Result<Self>
Run DNS and Pkarr servers on localhost with the specified node_origin
domain.
Sourcepub fn discovery(&self, secret_key: SecretKey) -> Box<ConcurrentDiscovery>
pub fn discovery(&self, secret_key: SecretKey) -> Box<ConcurrentDiscovery>
Create a ConcurrentDiscovery
with DnsDiscovery
and PkarrPublisher
configured to use the test servers.
Sourcepub fn dns_resolver(&self) -> DnsResolver
pub fn dns_resolver(&self) -> DnsResolver
Create a DnsResolver
configured to use the test DNS server.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DnsPkarrServer
impl !RefUnwindSafe for DnsPkarrServer
impl Send for DnsPkarrServer
impl Sync for DnsPkarrServer
impl Unpin for DnsPkarrServer
impl !UnwindSafe for DnsPkarrServer
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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