Struct xstack::SwitchBuilder
source · pub struct SwitchBuilder { /* private fields */ }
Expand description
A builder to create the Switch
instance.
Implementations§
source§impl SwitchBuilder
impl SwitchBuilder
sourcepub fn connector<C>(self, value: C) -> Selfwhere
C: DriverConnector + 'static,
pub fn connector<C>(self, value: C) -> Selfwhere
C: DriverConnector + 'static,
/// Replace default ConnPool
.
sourcepub fn event_mediator<K>(self, value: K) -> Selfwhere
K: DriverEventMediator + 'static,
pub fn event_mediator<K>(self, value: K) -> Selfwhere
K: DriverEventMediator + 'static,
Replace default SyncEventMediator
.
sourcepub fn keystore<K>(self, value: K) -> Selfwhere
K: DriverKeyStore + 'static,
pub fn keystore<K>(self, value: K) -> Selfwhere
K: DriverKeyStore + 'static,
Replace default MemoryKeyStore
.
sourcepub fn stream_dispatcher<K>(self, value: K) -> Selfwhere
K: DriverStreamDispatcher + 'static,
pub fn stream_dispatcher<K>(self, value: K) -> Selfwhere
K: DriverStreamDispatcher + 'static,
Replace default MutexStreamDispatcher
.
sourcepub fn peer_book<R>(self, value: R) -> Selfwhere
R: DriverPeerBook + 'static,
pub fn peer_book<R>(self, value: R) -> Selfwhere
R: DriverPeerBook + 'static,
Replace default MemoryPeerBook
.
sourcepub fn timeout(self, duration: Duration) -> Self
pub fn timeout(self, duration: Duration) -> Self
Set the protocol timeout, the default value is 10s
sourcepub fn max_observed_addrs_len(self, value: usize) -> Self
pub fn max_observed_addrs_len(self, value: usize) -> Self
Set the maximum length of observed addresses buffer.
sourcepub fn max_packet_size(self, value: usize) -> Self
pub fn max_packet_size(self, value: usize) -> Self
Set the maximum length of incoming rpc packets. the default value is 1024 * 1024 * 4
sourcepub fn connect_replication(self, value: usize) -> Self
pub fn connect_replication(self, value: usize) -> Self
Set the maximum number of concurrent connection tasks launched to a peer,
the default value is 5
sourcepub fn transport<T>(self, value: T) -> Selfwhere
T: DriverTransport + 'static,
pub fn transport<T>(self, value: T) -> Selfwhere
T: DriverTransport + 'static,
Register a new transport driver for the switch.
pub fn transport_bind<I, E>(self, laddrs: I) -> Self
Auto Trait Implementations§
impl Freeze for SwitchBuilder
impl !RefUnwindSafe for SwitchBuilder
impl Send for SwitchBuilder
impl Sync for SwitchBuilder
impl Unpin for SwitchBuilder
impl !UnwindSafe for SwitchBuilder
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