pub struct HoprLibp2pNetworkBuilder { /* private fields */ }Expand description
Builder of the network view and an actual background process running the libp2p core event processing loop.
This object is primarily constructed to allow delayed starting of the background process, as well as setup all the interconnections with the underlying network views to allow complex functionality and signalling.
Implementations§
Source§impl HoprLibp2pNetworkBuilder
impl HoprLibp2pNetworkBuilder
pub async fn new<T>(
identity: Keypair,
external_discovery_events: T,
my_multiaddresses: Vec<Multiaddr>,
) -> Selfwhere
T: Stream<Item = PeerDiscovery> + Send + 'static,
pub fn into_network_with_stream_protocol_process( self, protocol: &'static str, allow_private_addresses: bool, ) -> (HoprNetwork, impl Future<Output = ()>)
Trait Implementations§
Source§impl Debug for HoprLibp2pNetworkBuilder
impl Debug for HoprLibp2pNetworkBuilder
Source§impl From<HoprLibp2pNetworkBuilder> for Swarm<HoprNetworkBehavior>
impl From<HoprLibp2pNetworkBuilder> for Swarm<HoprNetworkBehavior>
Source§fn from(value: HoprLibp2pNetworkBuilder) -> Self
fn from(value: HoprLibp2pNetworkBuilder) -> Self
Converts to this type from the input type.
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