Struct xstack_kad::RouterOptions
source · pub struct RouterOptions { /* private fields */ }Expand description
The configuration for creating Router instance.
Implementations§
source§impl RouterOptions
impl RouterOptions
sourcepub fn set_concurrency(self, value: NonZeroUsize) -> Self
pub fn set_concurrency(self, value: NonZeroUsize) -> Self
Set the maximum concurrency tasks that this route process can starts,
the default value is a 3.
sourcepub fn set_store<S>(self, value: S) -> Selfwhere
S: DriverKadStore + 'static,
pub fn set_store<S>(self, value: S) -> Selfwhere
S: DriverKadStore + 'static,
Set the KadStore instance used by the router,
the default value is a instance of KadMemoryStore.
sourcepub fn set_rpc_timeout(self, value: Duration) -> Self
pub fn set_rpc_timeout(self, value: Duration) -> Self
Set the timeout wait for rpc calls, the default value is 10s.
sourcepub fn set_max_packet_size(self, value: usize) -> Self
pub fn set_max_packet_size(self, value: usize) -> Self
Set the maximum packet size received from peer, the default value is 1024 * 1024 * 4 bytes.
sourcepub async fn with_seeds<S, E>(self, switch: Switch, seeds: S) -> Result<Router>
pub async fn with_seeds<S, E>(self, switch: Switch, seeds: S) -> Result<Router>
Create a new kad router instance with provides boostrap peer seeds.
Trait Implementations§
source§impl Clone for RouterOptions
impl Clone for RouterOptions
source§fn clone(&self) -> RouterOptions
fn clone(&self) -> RouterOptions
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RouterOptions
impl !RefUnwindSafe for RouterOptions
impl Send for RouterOptions
impl Sync for RouterOptions
impl Unpin for RouterOptions
impl !UnwindSafe for RouterOptions
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)