pub struct NetworkConfig {
pub data_dir: PathBuf,
pub network_id: NetworkId,
pub schema_id: SchemaId,
pub max_message_size: usize,
pub request_timeout: Duration,
pub event_channel_capacity: usize,
pub max_concurrent_streams_per_peer: usize,
pub rendezvous: Option<RendezvousConfig>,
pub stream_protocols: Vec<Vec<u8>>,
pub schema_independent_stream_protocols: Vec<Vec<u8>>,
}Expand description
Configuration for a crate::NetworkEngine.
Use NetworkConfig::builder to construct a validated instance.
Fields§
§data_dir: PathBufDirectory where the persistent peer identity is stored.
network_id: NetworkIdIdentifier of the network this peer participates in.
schema_id: SchemaIdIdentifier of the domain message schema.
max_message_size: usizeMaximum size in bytes of a single encoded domain message.
request_timeout: DurationTimeout applied to handshakes and message round-trips.
event_channel_capacity: usizeCapacity of the bounded event channel.
max_concurrent_streams_per_peer: usizeMaximum number of concurrently processed streams per peer.
rendezvous: Option<RendezvousConfig>Automatic peer discovery over the mainline DHT; None disables it and
peers are connected via tickets only.
stream_protocols: Vec<Vec<u8>>Auxiliary ALPN protocols on which this peer accepts raw byte streams
(see crate::NetworkEngine::stream_acceptor).
schema_independent_stream_protocols: Vec<Vec<u8>>Auxiliary stream protocols whose handshake is independent of the application schema. Intended for compatibility/capability discovery.
Implementations§
Source§impl NetworkConfig
impl NetworkConfig
Sourcepub fn builder() -> NetworkConfigBuilder
pub fn builder() -> NetworkConfigBuilder
Returns a new NetworkConfigBuilder.
Trait Implementations§
Source§impl Clone for NetworkConfig
impl Clone for NetworkConfig
Auto Trait Implementations§
impl Freeze for NetworkConfig
impl RefUnwindSafe for NetworkConfig
impl Send for NetworkConfig
impl Sync for NetworkConfig
impl Unpin for NetworkConfig
impl UnsafeUnpin for NetworkConfig
impl UnwindSafe for NetworkConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more