pub struct PkarrPublisher { /* private fields */ }Expand description
Publisher of address lookup information to a pkarr relay.
This publisher uses HTTP to publish address lookup information to a pkarr relay server, see the module docs for details.
This implements the AddressLookup trait to be used as an address lookup service. Note
that it only publishes address lookup information, for the corresponding resolver use
the PkarrResolver together with AddressLookupServices.
By default this publisher only publishes the RelayUrl, to avoid leaking IP addresses to
the public pkarr server. Which addresses are published is controlled by the AddrFilter
set via PkarrPublisherBuilder::addr_filter.
Implementations§
Source§impl PkarrPublisher
impl PkarrPublisher
Sourcepub fn builder(pkarr_relay: Url) -> PkarrPublisherBuilder
pub fn builder(pkarr_relay: Url) -> PkarrPublisherBuilder
Returns a PkarrPublisherBuilder that publishes endpoint info to a pkarr relay at pkarr_relay.
If no further options are set, the pkarr publisher will use DEFAULT_PKARR_TTL as the
time-to-live value for the published packets, and it will republish Address Lookup information
every DEFAULT_REPUBLISH_INTERVAL, even if the information is unchanged.
PkarrPublisherBuilder implements AddressLookupBuilder, so it can be passed to address_lookup.
It will then use the endpoint’s secret key to sign published packets.
Sourcepub fn n0_dns() -> PkarrPublisherBuilder
pub fn n0_dns() -> PkarrPublisherBuilder
Creates a pkarr publisher which uses the number 0 pkarr relay server.
This uses the pkarr relay server operated by number 0, at
N0_DNS_PKARR_RELAY_PROD.
When running with the environment variable
IROH_FORCE_STAGING_RELAYS set to any non empty value N0_DNS_PKARR_RELAY_STAGING
server is used instead.
Sourcepub fn update_endpoint_data(&self, data: &EndpointData)
pub fn update_endpoint_data(&self, data: &EndpointData)
Publishes the addressing information about this endpoint to a pkarr relay.
This is a nonblocking function, the actual update is performed in the background.
Trait Implementations§
Source§impl AddressLookup for PkarrPublisher
impl AddressLookup for PkarrPublisher
Source§fn publish(&self, data: &EndpointData)
fn publish(&self, data: &EndpointData)
EndpointData to the Address Lookup mechanism. Read moreSource§impl Clone for PkarrPublisher
impl Clone for PkarrPublisher
Source§fn clone(&self) -> PkarrPublisher
fn clone(&self) -> PkarrPublisher
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for PkarrPublisher
impl !RefUnwindSafe for PkarrPublisher
impl Send for PkarrPublisher
impl Sync for PkarrPublisher
impl Unpin for PkarrPublisher
impl !UnwindSafe for PkarrPublisher
Blanket Implementations§
Source§impl<T> AddressLookupBuilder for Twhere
T: AddressLookup,
impl<T> AddressLookupBuilder for Twhere
T: AddressLookup,
Source§fn into_address_lookup(
self,
_endpoint: &Endpoint,
) -> Result<impl AddressLookup, AddressLookupBuilderError>
fn into_address_lookup( self, _endpoint: &Endpoint, ) -> Result<impl AddressLookup, AddressLookupBuilderError>
AddressLookup. Read more§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
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>
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