[−][src]Struct libp2p_swarm::SwarmBuilder
Methods
impl<TBehaviour, TConnInfo> SwarmBuilder<TBehaviour, TConnInfo> where
TBehaviour: NetworkBehaviour,
TConnInfo: ConnectionInfo<PeerId = PeerId> + Debug + Clone + Send + 'static,
[src]
TBehaviour: NetworkBehaviour,
TConnInfo: ConnectionInfo<PeerId = PeerId> + Debug + Clone + Send + 'static,
pub fn new<TTransport, TMuxer>(
transport: TTransport,
behaviour: TBehaviour,
local_peer_id: PeerId
) -> Self where
TMuxer: StreamMuxer + Send + Sync + 'static,
TMuxer::OutboundSubstream: Send + 'static,
<TMuxer as StreamMuxer>::OutboundSubstream: Send + 'static,
<TMuxer as StreamMuxer>::Substream: Send + 'static,
TTransport: Transport<Output = (TConnInfo, TMuxer)> + Clone + Send + Sync + 'static,
TTransport::Error: Send + Sync + 'static,
TTransport::Listener: Send + 'static,
TTransport::ListenerUpgrade: Send + 'static,
TTransport::Dial: Send + 'static,
[src]
transport: TTransport,
behaviour: TBehaviour,
local_peer_id: PeerId
) -> Self where
TMuxer: StreamMuxer + Send + Sync + 'static,
TMuxer::OutboundSubstream: Send + 'static,
<TMuxer as StreamMuxer>::OutboundSubstream: Send + 'static,
<TMuxer as StreamMuxer>::Substream: Send + 'static,
TTransport: Transport<Output = (TConnInfo, TMuxer)> + Clone + Send + Sync + 'static,
TTransport::Error: Send + Sync + 'static,
TTransport::Listener: Send + 'static,
TTransport::ListenerUpgrade: Send + 'static,
TTransport::Dial: Send + 'static,
pub fn incoming_limit(self, incoming_limit: Option<u32>) -> Self
[src]
pub fn executor(self, executor: impl Executor + Send + 'static) -> Self
[src]
Sets the executor to use to spawn background tasks.
By default, uses a threads pool.
pub fn executor_fn(
self,
executor: impl Fn(Pin<Box<dyn Future<Output = ()> + Send>>) + Send + 'static
) -> Self
[src]
self,
executor: impl Fn(Pin<Box<dyn Future<Output = ()> + Send>>) + Send + 'static
) -> Self
Shortcut for calling executor
with an object that calls the given closure.
pub fn build(self) -> Swarm<TBehaviour, TConnInfo>
[src]
Auto Trait Implementations
impl<TBehaviour, TConnInfo> !RefUnwindSafe for SwarmBuilder<TBehaviour, TConnInfo>
impl<TBehaviour, TConnInfo> Send for SwarmBuilder<TBehaviour, TConnInfo> where
TBehaviour: Send,
TBehaviour: Send,
impl<TBehaviour, TConnInfo> !Sync for SwarmBuilder<TBehaviour, TConnInfo>
impl<TBehaviour, TConnInfo> Unpin for SwarmBuilder<TBehaviour, TConnInfo> where
TBehaviour: Unpin,
TBehaviour: Unpin,
impl<TBehaviour, TConnInfo> !UnwindSafe for SwarmBuilder<TBehaviour, TConnInfo>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,