pub struct DnsPkarrServer { /* private fields */ }Available on crate features
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.
Implementations§
Source§impl DnsPkarrServer
impl DnsPkarrServer
Sourcepub async fn run_with_origin(endpoint_origin: String) -> Result<Self>
pub async fn run_with_origin(endpoint_origin: String) -> Result<Self>
Run DNS and Pkarr servers on localhost with the specified endpoint_origin domain.
Sourcepub fn preset(&self) -> impl Preset
pub fn preset(&self) -> impl Preset
Returns a Preset to apply the DNS address lookup and Pkarr Publisher to an endpoint.
Sourcepub fn dns_resolver(&self) -> DnsResolver
pub fn dns_resolver(&self) -> DnsResolver
Create a DnsResolver configured to use the test DNS server.
Sourcepub async fn on_endpoint(
&self,
endpoint_id: &EndpointId,
timeout: Duration,
) -> Result<()>
pub async fn on_endpoint( &self, endpoint_id: &EndpointId, timeout: Duration, ) -> Result<()>
Wait until a Pkarr announce for an endpoint is published to the server.
If timeout elapses an error is returned.
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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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