pub struct DhtBuilder(/* private fields */);Expand description
A builder for the Dht node.
Implementations§
Source§impl DhtBuilder
impl DhtBuilder
Sourcepub fn server_mode(&mut self) -> &mut Self
pub fn server_mode(&mut self) -> &mut Self
Set this node’s server_mode.
Sourcepub fn server_settings(&mut self, server_settings: ServerSettings) -> &mut Self
pub fn server_settings(&mut self, server_settings: ServerSettings) -> &mut Self
Set a custom settings for the node to use at server mode.
Defaults to ServerSettings::default
Sourcepub fn bootstrap<T: ToString>(&mut self, bootstrap: &[T]) -> &mut Self
pub fn bootstrap<T: ToString>(&mut self, bootstrap: &[T]) -> &mut Self
Set bootstrapping nodes.
Sourcepub fn extra_bootstrap<T: ToString>(
&mut self,
extra_bootstrap: &[T],
) -> &mut Self
pub fn extra_bootstrap<T: ToString>( &mut self, extra_bootstrap: &[T], ) -> &mut Self
Add more bootstrap nodes to default bootstrapping nodes.
Useful when you want to augment the default bootstrapping nodes with dynamic list of nodes you have seen in previous sessions.
Sourcepub fn no_bootstrap(&mut self) -> &mut Self
pub fn no_bootstrap(&mut self) -> &mut Self
Remove the existing bootstrapping nodes, usually to create the first node in a new network.
Trait Implementations§
Source§impl Clone for DhtBuilder
impl Clone for DhtBuilder
Source§fn clone(&self) -> DhtBuilder
fn clone(&self) -> DhtBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DhtBuilder
impl Debug for DhtBuilder
Source§impl Default for DhtBuilder
impl Default for DhtBuilder
Source§fn default() -> DhtBuilder
fn default() -> DhtBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DhtBuilder
impl !RefUnwindSafe for DhtBuilder
impl Send for DhtBuilder
impl Sync for DhtBuilder
impl Unpin for DhtBuilder
impl UnsafeUnpin for DhtBuilder
impl !UnwindSafe for DhtBuilder
Blanket Implementations§
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