[][src]Struct tari_comms::CommsBuilder

pub struct CommsBuilder { /* fields omitted */ }

The CommsBuilder provides a simple builder API for getting Tari comms p2p messaging up and running.

Implementations

impl CommsBuilder[src]

pub fn new() -> Self[src]

Create a new CommsBuilder instance

pub fn with_node_identity(
    mut self: Self,
    node_identity: Arc<NodeIdentity>
) -> Self
[src]

Set the NodeIdentity for this comms instance. This is required.

pub fn with_shutdown_signal(
    mut self: Self,
    shutdown_signal: ShutdownSignal
) -> Self
[src]

Set the shutdown signal for this comms instance

pub fn with_user_agent<T: ToString>(mut self: Self, user_agent: T) -> Self[src]

Set the user agent string for this comms node. This string is sent once when establishing a connection.

pub fn allow_test_addresses(mut self: Self) -> Self[src]

Allow test addresses (memory addresses, local loopback etc). This should only be activated for tests.

pub fn with_listener_address(
    mut self: Self,
    listener_address: Multiaddr
) -> Self
[src]

pub fn with_listener_liveness_max_sessions(
    mut self: Self,
    max_sessions: usize
) -> Self
[src]

pub fn with_listener_liveness_allowlist_cidrs(
    mut self: Self,
    cidrs: Vec<AnyIpCidr>
) -> Self
[src]

pub fn with_max_simultaneous_inbound_connects(
    mut self: Self,
    max_simultaneous_inbound_connects: usize
) -> Self
[src]

The maximum number of connection tasks that will be spawned at the same time. Once this limit is reached, peers attempting to connect will have to wait for another connection attempt to complete.

pub fn with_max_dial_attempts(mut self: Self, max_dial_attempts: usize) -> Self[src]

The number of dial attempts to make before giving up.

pub fn with_min_connectivity(mut self: Self, min_connectivity: f32) -> Self[src]

Sets the minimum required connectivity as a percentage of peers added to the connectivity manager peer set.

pub fn disable_connection_reaping(mut self: Self) -> Self[src]

Call to disable connection reaping. Usually you would want to have this enabled, however there are some test cases where disabling this is desirable.

pub fn with_peer_storage(
    mut self: Self,
    peer_storage: CommsDatabase,
    file_lock: Option<File>
) -> Self
[src]

Set the peer storage database to use.

pub fn with_dial_backoff<T>(mut self: Self, backoff: T) -> Self where
    T: Backoff + Send + Sync + 'static, 
[src]

Set the backoff that [ConnectionManager] uses when dialing peers. This is optional. If omitted the default ExponentialBackoff is used. [ConnectionManager]: crate::connection_manager::next::ConnectionManager

pub fn build(mut self: Self) -> Result<UnspawnedCommsNode, CommsBuilderError>[src]

Build comms services and handles. Services will not be started.

Trait Implementations

impl Default for CommsBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> Cast<U> for T where
    U: FromCast<T>, 

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> FromBits<T> for T

impl<T> FromCast<T> for T

impl<T> InitializableFromZeroed for T where
    T: Default
[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> IntoBits<U> for T where
    U: FromBits<T>, 

impl<T> SafeBorrow<T> for T where
    T: ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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