pub struct NodeBuilder { /* private fields */ }Expand description
Builder pattern for creating P2P nodes
Implementations§
Source§impl NodeBuilder
impl NodeBuilder
Sourcepub fn with_peer_id(self, peer_id: PeerId) -> Self
pub fn with_peer_id(self, peer_id: PeerId) -> Self
Set the peer ID
Sourcepub fn with_bootstrap_peer(self, addr: &str) -> Self
pub fn with_bootstrap_peer(self, addr: &str) -> Self
Add a bootstrap peer
Sourcepub fn with_connection_timeout(self, timeout: Duration) -> Self
pub fn with_connection_timeout(self, timeout: Duration) -> Self
Set connection timeout
Sourcepub fn with_max_connections(self, max: usize) -> Self
pub fn with_max_connections(self, max: usize) -> Self
Set maximum connections
Sourcepub fn with_production_mode(self) -> Self
pub fn with_production_mode(self) -> Self
Enable production mode with default configuration
Sourcepub fn with_production_config(self, production_config: ProductionConfig) -> Self
pub fn with_production_config(self, production_config: ProductionConfig) -> Self
Configure production settings
Sourcepub fn with_diversity_config(self, diversity_config: IPDiversityConfig) -> Self
pub fn with_diversity_config(self, diversity_config: IPDiversityConfig) -> Self
Configure IP diversity limits for Sybil protection.
Sourcepub fn with_default_dht(self) -> Self
pub fn with_default_dht(self) -> Self
Enable DHT with default configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NodeBuilder
impl RefUnwindSafe for NodeBuilder
impl Send for NodeBuilder
impl Sync for NodeBuilder
impl Unpin for NodeBuilder
impl UnsafeUnpin for NodeBuilder
impl UnwindSafe for NodeBuilder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.