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: Box<dyn KvStorageInterface<Entry> + Sync + Send>,
session_sk: SessionSk,
) -> SwarmBuilder
pub fn new( network_id: u32, ice_servers: &str, dht_storage: Box<dyn KvStorageInterface<Entry> + Sync + Send>, session_sk: SessionSk, ) -> SwarmBuilder
Creates new instance of SwarmBuilder
Sourcepub fn dht_succ_max(self, succ_max: u8) -> SwarmBuilder
pub fn dht_succ_max(self, succ_max: u8) -> SwarmBuilder
Sets up the maximum length of successors in the DHT.
Sourcepub fn dht_finger_table_size(self, size: usize) -> SwarmBuilder
pub fn dht_finger_table_size(self, size: usize) -> SwarmBuilder
Sets up the number of slots in the DHT finger table.
Did is 160-bit, so values above DEFAULT_FINGER_TABLE_SIZE are clamped
by FingerTable::new. A size of zero disables finger maintenance.
Sourcepub fn dht_storage_redundancy(self, redundancy: u16) -> SwarmBuilder
pub fn dht_storage_redundancy(self, redundancy: u16) -> SwarmBuilder
Sets up the redundancy used by storage repair and anti-entropy.
Sourcepub fn dht_virtual_nodes(self, positions_per_peer: u16) -> SwarmBuilder
pub fn dht_virtual_nodes(self, positions_per_peer: u16) -> SwarmBuilder
Sets storage-only Chord virtual positions derived per physical peer.
By default, Rings follows the Chord paper’s O(log N) virtual-node
guidance through crate::dht::DEFAULT_STORAGE_VIRTUAL_POSITIONS_PER_OWNER.
A value of zero disables virtual-node storage ownership. Values above
crate::dht::MAX_STORAGE_VIRTUAL_POSITIONS_PER_OWNER are normalized
once during Self::build. The same bounded value is used for both
storage ownership and advertised protocol mode.
Sourcepub fn reassembly_limits(self, limits: ReassemblyLimits) -> SwarmBuilder
pub fn reassembly_limits(self, limits: ReassemblyLimits) -> SwarmBuilder
Sets inbound chunk reassembly limits.
Sourcepub fn external_address(self, external_address: String) -> SwarmBuilder
pub fn external_address(self, external_address: String) -> SwarmBuilder
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 webrtc_udp_port_range(self, range: WebrtcUdpPortRange) -> SwarmBuilder
pub fn webrtc_udp_port_range(self, range: WebrtcUdpPortRange) -> SwarmBuilder
Sets the native WebRTC UDP port range used during ICE gathering.
Invariant: a present range has already proven 1 <= min <= max.
Browser transports ignore this native deployment setting.
Sourcepub fn session_ttl(self, ttl: usize) -> SwarmBuilder
pub fn session_ttl(self, ttl: usize) -> SwarmBuilder
Setup timeout for session.
Sourcepub fn measure(
self,
implement: Arc<dyn BehaviourJudgement + Sync + Send>,
) -> SwarmBuilder
pub fn measure( self, implement: Arc<dyn BehaviourJudgement + Sync + Send>, ) -> SwarmBuilder
Bind measurement function for Swarm.
Sourcepub fn callback(
self,
callback: Arc<dyn SwarmCallback + Sync + Send>,
) -> SwarmBuilder
pub fn callback( self, callback: Arc<dyn SwarmCallback + Sync + Send>, ) -> SwarmBuilder
Bind callback for Swarm.
Auto Trait Implementations§
impl !RefUnwindSafe for SwarmBuilder
impl !UnwindSafe for SwarmBuilder
impl Freeze for SwarmBuilder
impl Send for SwarmBuilder
impl Sync for SwarmBuilder
impl Unpin for SwarmBuilder
impl UnsafeUnpin for SwarmBuilder
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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> ⓘ
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T> MaybeSend for T
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.