iroh_net::discovery::pkarr::dht

Struct Builder

Source
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

Source

pub fn client(self, client: PkarrClient) -> Self

Explicitly sets the pkarr client to use.

Source

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.

Source

pub fn ttl(self, ttl: u32) -> Self

Sets the time-to-live value for the DNS packets.

Source

pub fn pkarr_relay(self, pkarr_relay: Url) -> Self

Sets the pkarr relay URL to use.

Source

pub fn n0_dns_pkarr_relay(self) -> Self

Uses the default number 0 pkarr relay URL.

Source

pub fn dht(self, dht: bool) -> Self

Sets whether to publish to the Mainline DHT.

Source

pub fn include_direct_addresses(self, include_direct_addresses: bool) -> Self

Sets whether to include the direct addresses in the DNS packet.

Source

pub fn initial_publish_delay(self, initial_publish_delay: Duration) -> Self

Sets the initial delay before the first publish.

Source

pub fn republish_delay(self, republish_delay: Duration) -> Self

Sets the republish delay for the DHT.

Source

pub fn build(self) -> Result<DhtDiscovery>

Builds the discovery mechanism.

Trait Implementations§

Source§

impl Debug for Builder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Builder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T