pub struct Config {
pub membership: Config,
pub broadcast: Config,
pub max_message_size: usize,
}Expand description
Protocol configuration
Fields§
§membership: ConfigConfiguration for the swarm membership layer
broadcast: ConfigConfiguration for the gossip broadcast layer
max_message_size: usizeMax message size in bytes.
This size should be the same across a network to ensure all nodes can transmit and read large messages.
At minimum, this size should be large enough to send gossip control messages. This can vary, depending on the size of the PeerIdentity you use and the size of the PeerData you transmit in your messages.
The default is DEFAULT_MAX_MESSAGE_SIZE.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Config> for NetworkConfig
Available on crate features test-utils only.
impl From<Config> for NetworkConfig
Available on crate features
test-utils only.Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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