Struct libp2p_core::network::NetworkConfig [−][src]
The (optional) configuration for a Network
.
The default configuration specifies no dedicated task executor, no
connection limits, a connection event buffer size of 32, and a
notify_handler
buffer size of 8.
Implementations
impl NetworkConfig
[src]
pub fn with_executor(self, e: Box<dyn Executor + Send>) -> Self
[src]
Configures the executor to use for spawning connection background tasks.
pub fn or_else_with_executor<F>(self, f: F) -> Self where
F: FnOnce() -> Option<Box<dyn Executor + Send>>,
[src]
F: FnOnce() -> Option<Box<dyn Executor + Send>>,
Configures the executor to use for spawning connection background tasks, only if no executor has already been configured.
pub fn with_notify_handler_buffer_size(self, n: NonZeroUsize) -> Self
[src]
Sets the maximum number of events sent to a connection's background task that may be buffered, if the task cannot keep up with their consumption and delivery to the connection handler.
When the buffer for a particular connection is full, notify_handler
will no
longer be able to deliver events to the associated ConnectionHandler
,
thus exerting back-pressure on the connection and peer API.
pub fn with_connection_event_buffer_size(self, n: usize) -> Self
[src]
Sets the maximum number of buffered connection events (beyond a guaranteed buffer of 1 event per connection).
When the buffer is full, the background tasks of all connections will stall. In this way, the consumers of network events exert back-pressure on the network connection I/O.
pub fn with_connection_limits(self, limits: ConnectionLimits) -> Self
[src]
Sets the connection limits to enforce.
Trait Implementations
impl Default for NetworkConfig
[src]
fn default() -> NetworkConfig
[src]
Auto Trait Implementations
impl !RefUnwindSafe for NetworkConfig
[src]
impl Send for NetworkConfig
[src]
impl !Sync for NetworkConfig
[src]
impl Unpin for NetworkConfig
[src]
impl !UnwindSafe for NetworkConfig
[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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<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>,