pub struct HoprLibp2pNetworkBuilder {
bootstrap: Pin<Box<dyn Stream<Item = PeerDiscovery> + Send + Sync>>,
}Expand description
Factory for constructing the libp2p network and its background process.
Accepts a peer discovery stream and produces a HoprNetwork + background
process function. The network supports event subscription via
NetworkView::subscribe_network_events.
Fields§
§bootstrap: Pin<Box<dyn Stream<Item = PeerDiscovery> + Send + Sync>>Implementations§
Source§impl HoprLibp2pNetworkBuilder
impl HoprLibp2pNetworkBuilder
Source§impl HoprLibp2pNetworkBuilder
impl HoprLibp2pNetworkBuilder
Sourcepub async fn build(
self,
identity: &OffchainKeypair,
my_multiaddresses: Vec<Multiaddr>,
protocol: &'static str,
allow_private_addresses: bool,
) -> Result<(HoprNetwork, BoxedProcessFn), impl Error>
pub async fn build( self, identity: &OffchainKeypair, my_multiaddresses: Vec<Multiaddr>, protocol: &'static str, allow_private_addresses: bool, ) -> Result<(HoprNetwork, BoxedProcessFn), impl Error>
Build the network and return it along with its background process.
The returned HoprNetwork supports event subscription — subscribe
before starting the process to avoid missing events.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HoprLibp2pNetworkBuilder
impl !RefUnwindSafe for HoprLibp2pNetworkBuilder
impl Send for HoprLibp2pNetworkBuilder
impl Sync for HoprLibp2pNetworkBuilder
impl Unpin for HoprLibp2pNetworkBuilder
impl !UnwindSafe for HoprLibp2pNetworkBuilder
Blanket Implementations§
§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, 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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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