pub struct PkarrPublisherBuilder { /* private fields */ }Expand description
Builder for PkarrPublisher.
Implementations§
Source§impl PkarrPublisherBuilder
impl PkarrPublisherBuilder
Sourcepub fn ttl(self, ttl: u32) -> Self
pub fn ttl(self, ttl: u32) -> Self
Sets the TTL (time-to-live) for published packets.
Default is DEFAULT_PKARR_TTL.
Sourcepub fn republish_interval(self, republish_interval: Duration) -> Self
pub fn republish_interval(self, republish_interval: Duration) -> Self
Sets the interval after which packets are republished even if our endpoint info did not change.
Default is DEFAULT_REPUBLISH_INTERVAL.
Sourcepub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
Available on non-wasm_browser only.
pub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self
wasm_browser only.Sets the DNS resolver to use for resolving the pkarr relay URL.
Sourcepub fn addr_filter(self, filter: AddrFilter) -> Self
pub fn addr_filter(self, filter: AddrFilter) -> Self
Sets the address filter to control which addresses are published to the pkarr server.
By default AddrFilter::relay_only is used. This avoids leaking IP addresses to the
public pkarr server.
However, enabling IP address publishing can be useful, e.g. when iroh runs on a machine connected to the internet via public IP addresses without a firewall. In such cases, publishing them can make dialing such endpoints via DNS or Pkarr lookup faster, potentially skipping a relay connection altogether.
Sourcepub fn build(
self,
secret_key: SecretKey,
tls_config: ClientConfig,
) -> PkarrPublisher
pub fn build( self, secret_key: SecretKey, tls_config: ClientConfig, ) -> PkarrPublisher
Builds the PkarrPublisher with the passed secret key for signing packets.
This publisher will be able to publish pkarr records for SecretKey.
Trait Implementations§
Source§impl AddressLookupBuilder for PkarrPublisherBuilder
impl AddressLookupBuilder for PkarrPublisherBuilder
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 moreAuto Trait Implementations§
impl Freeze for PkarrPublisherBuilder
impl !RefUnwindSafe for PkarrPublisherBuilder
impl Send for PkarrPublisherBuilder
impl Sync for PkarrPublisherBuilder
impl Unpin for PkarrPublisherBuilder
impl !UnwindSafe for PkarrPublisherBuilder
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
§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