Struct rings_core::swarm::SwarmBuilder
source · pub struct SwarmBuilder { /* private fields */ }Expand description
Creates a SwarmBuilder to configure a Swarm.
Implementations§
source§impl SwarmBuilder
impl SwarmBuilder
sourcepub fn new(
network_id: u32,
ice_servers: &str,
dht_storage: VNodeStorage,
session_sk: SessionSk
) -> Self
pub fn new( network_id: u32, ice_servers: &str, dht_storage: VNodeStorage, session_sk: SessionSk ) -> Self
Creates new instance of SwarmBuilder
sourcepub fn dht_succ_max(self, succ_max: u8) -> Self
pub fn dht_succ_max(self, succ_max: u8) -> Self
Sets up the maximum length of successors in the DHT.
sourcepub fn external_address(self, external_address: String) -> Self
pub fn external_address(self, external_address: String) -> Self
Sets up the external address for swarm transport. This will be used to configure the transport to listen for WebRTC connections in “HOST” mode.
sourcepub fn session_ttl(self, ttl: usize) -> Self
pub fn session_ttl(self, ttl: usize) -> Self
Setup timeout for session.
sourcepub fn measure(self, implement: MeasureImpl) -> Self
pub fn measure(self, implement: MeasureImpl) -> Self
Bind measurement function for Swarm.
sourcepub fn callback(self, callback: SharedSwarmCallback) -> Self
pub fn callback(self, callback: SharedSwarmCallback) -> Self
Bind callback for Swarm.
Auto Trait Implementations§
impl Freeze for SwarmBuilder
impl !RefUnwindSafe for SwarmBuilder
impl Send for SwarmBuilder
impl Sync for SwarmBuilder
impl Unpin for SwarmBuilder
impl !UnwindSafe for SwarmBuilder
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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>
Converts
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>
Converts
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