Struct litep2p::protocol::request_response::ConfigBuilder
source · pub struct ConfigBuilder { /* private fields */ }
Expand description
Builder for Config
.
Implementations§
source§impl ConfigBuilder
impl ConfigBuilder
sourcepub fn new(protocol_name: ProtocolName) -> Self
pub fn new(protocol_name: ProtocolName) -> Self
Create new ConfigBuilder
.
sourcepub fn with_max_size(self, max_message_size: usize) -> Self
pub fn with_max_size(self, max_message_size: usize) -> Self
Set maximum message size.
sourcepub fn with_fallback_names(self, fallback_names: Vec<ProtocolName>) -> Self
pub fn with_fallback_names(self, fallback_names: Vec<ProtocolName>) -> Self
Set fallback names.
sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set timeout for outbound requests.
sourcepub fn with_max_concurrent_inbound_requests(
self,
max_concurrent_inbound_requests: usize,
) -> Self
pub fn with_max_concurrent_inbound_requests( self, max_concurrent_inbound_requests: usize, ) -> Self
Specify the maximum number of concurrent inbound requests. By default the number of inbound requests is not limited.
If a new request is received while the number of inbound requests is already at a maximum, the request is dropped.
sourcepub fn build(self) -> (Config, RequestResponseHandle)
pub fn build(self) -> (Config, RequestResponseHandle)
Build Config
.
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
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