pub struct Builder { /* private fields */ }
Available on crate feature
discovery-pkarr-dht
only.Expand description
Builder for DhtDiscovery
.
By default, publishing to the DHT is enabled, and relay publishing is disabled.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn client(self, client: PkarrClient) -> Self
pub fn client(self, client: PkarrClient) -> Self
Explicitly sets the pkarr client to use.
Sourcepub fn secret_key(self, secret_key: SecretKey) -> Self
pub fn secret_key(self, secret_key: SecretKey) -> Self
Sets the secret key to use for signing the DNS packets.
Without a secret key, the node will not publish its address to the DHT.
Sourcepub fn pkarr_relay(self, pkarr_relay: Url) -> Self
pub fn pkarr_relay(self, pkarr_relay: Url) -> Self
Sets the pkarr relay URL to use.
Sourcepub fn n0_dns_pkarr_relay(self) -> Self
pub fn n0_dns_pkarr_relay(self) -> Self
Uses the default number 0 pkarr relay URL.
Sourcepub fn include_direct_addresses(self, include_direct_addresses: bool) -> Self
pub fn include_direct_addresses(self, include_direct_addresses: bool) -> Self
Sets whether to include the direct addresses in the DNS packet.
Sourcepub fn initial_publish_delay(self, initial_publish_delay: Duration) -> Self
pub fn initial_publish_delay(self, initial_publish_delay: Duration) -> Self
Sets the initial delay before the first publish.
Sourcepub fn republish_delay(self, republish_delay: Duration) -> Self
pub fn republish_delay(self, republish_delay: Duration) -> Self
Sets the republish delay for the DHT.
Sourcepub fn build(self) -> Result<DhtDiscovery>
pub fn build(self) -> Result<DhtDiscovery>
Builds the discovery mechanism.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Builder
impl !RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl !UnwindSafe for Builder
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