Struct rings_node::prelude::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(
ice_servers: &str,
dht_storage: KvStorage,
session_sk: SessionSk
) -> SwarmBuilder
pub fn new( ice_servers: &str, dht_storage: KvStorage, 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 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 session_ttl(self, ttl: usize) -> SwarmBuilder
pub fn session_ttl(self, ttl: usize) -> SwarmBuilder
Setup timeout for session.
sourcepub fn measure(
self,
implement: Box<dyn BehaviourJudgement + Sync + Send, Global>
) -> SwarmBuilder
pub fn measure( self, implement: Box<dyn BehaviourJudgement + Sync + Send, Global> ) -> SwarmBuilder
Bind measurement function for Swarm.
sourcepub fn message_callback(
self,
callback: Box<dyn MessageCallback + Sync + Send, Global>
) -> SwarmBuilder
pub fn message_callback( self, callback: Box<dyn MessageCallback + Sync + Send, Global> ) -> SwarmBuilder
Bind message callback function for Swarm.
sourcepub fn message_validator(
self,
validator: Box<dyn MessageValidator + Sync + Send, Global>
) -> SwarmBuilder
pub fn message_validator( self, validator: Box<dyn MessageValidator + Sync + Send, Global> ) -> SwarmBuilder
Bind message vilidator function implementation for Swarm.
Auto Trait Implementations§
impl !RefUnwindSafe for SwarmBuilder
impl Send for SwarmBuilder
impl Sync for SwarmBuilder
impl Unpin for SwarmBuilder
impl !UnwindSafe for SwarmBuilder
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
§impl<'a, T> AsTaggedExplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedExplicit<'a> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T> AsTaggedImplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedImplicit<'a> for Twhere T: 'a,
§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
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Upcastable for Twhere
T: Any + Send + Sync + 'static,
impl<T> Upcastable for Twhere T: Any + Send + Sync + 'static,
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref