[−][src]Struct tari_comms::CommsBuilder
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]
mut self: Self,
node_identity: Arc<NodeIdentity>
) -> Self
Set the NodeIdentity for this comms instance. This is required.
pub fn with_shutdown_signal(
mut self: Self,
shutdown_signal: ShutdownSignal
) -> Self
[src]
mut self: Self,
shutdown_signal: ShutdownSignal
) -> Self
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]
mut self: Self,
listener_address: Multiaddr
) -> Self
pub fn with_listener_liveness_max_sessions(
mut self: Self,
max_sessions: usize
) -> Self
[src]
mut self: Self,
max_sessions: usize
) -> Self
pub fn with_listener_liveness_allowlist_cidrs(
mut self: Self,
cidrs: Vec<AnyIpCidr>
) -> Self
[src]
mut self: Self,
cidrs: Vec<AnyIpCidr>
) -> Self
pub fn with_max_simultaneous_inbound_connects(
mut self: Self,
max_simultaneous_inbound_connects: usize
) -> Self
[src]
mut self: Self,
max_simultaneous_inbound_connects: usize
) -> Self
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]
mut self: Self,
peer_storage: CommsDatabase,
file_lock: Option<File>
) -> Self
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]
T: Backoff + Send + Sync + 'static,
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
impl !RefUnwindSafe for CommsBuilder
[src]
impl Send for CommsBuilder
[src]
impl Sync for CommsBuilder
[src]
impl Unpin for CommsBuilder
[src]
impl !UnwindSafe for CommsBuilder
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> Cast<U> for T where
U: FromCast<T>,
U: FromCast<T>,
pub fn cast(self) -> U
impl<T> Clear for T where
T: InitializableFromZeroed + ?Sized,
[src]
T: InitializableFromZeroed + ?Sized,
impl<T> From<T> for T
[src]
impl<T> FromBits<T> for T
pub fn from_bits(t: T) -> T
impl<T> FromCast<T> for T
pub fn from_cast(t: T) -> T
impl<T> InitializableFromZeroed for T where
T: Default,
[src]
T: Default,
pub unsafe fn initialize(place: *mut T)
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> IntoBits<U> for T where
U: FromBits<T>,
U: FromBits<T>,
pub fn into_bits(self) -> U
impl<T> SafeBorrow<T> for T where
T: ?Sized,
T: ?Sized,
pub fn borrow_replacement(ptr: &T) -> &T
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,