Struct libp2p_swarm_test::ListenFuture
source · pub struct ListenFuture<S> { /* private fields */ }
Implementations§
source§impl<S> ListenFuture<S>
impl<S> ListenFuture<S>
sourcepub fn with_memory_addr_external(self) -> Self
pub fn with_memory_addr_external(self) -> Self
Adds the memory address we are starting to listen on as an external address using Swarm::add_external_address
.
This is typically “safe” for tests because within a process, memory addresses are “globally” reachable. However, some tests depend on which addresses are external and need this to be configurable so it is not a good default.
sourcepub fn with_tcp_addr_external(self) -> Self
pub fn with_tcp_addr_external(self) -> Self
Adds the TCP address we are starting to listen on as an external address using Swarm::add_external_address
.
This is typically “safe” for tests because on the same machine, 127.0.0.1 is reachable for other Swarm
s.
However, some tests depend on which addresses are external and need this to be configurable so it is not a good default.
Trait Implementations§
source§impl<'s, B> IntoFuture for ListenFuture<&'s mut Swarm<B>>
impl<'s, B> IntoFuture for ListenFuture<&'s mut Swarm<B>>
§type IntoFuture = Pin<Box<dyn Future<Output = <ListenFuture<&'s mut Swarm<B>> as IntoFuture>::Output> + Send + 's>>
type IntoFuture = Pin<Box<dyn Future<Output = <ListenFuture<&'s mut Swarm<B>> as IntoFuture>::Output> + Send + 's>>
Which kind of future are we turning this into?
source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl<S> RefUnwindSafe for ListenFuture<S>where
S: RefUnwindSafe,
impl<S> Send for ListenFuture<S>where
S: Send,
impl<S> Sync for ListenFuture<S>where
S: Sync,
impl<S> Unpin for ListenFuture<S>where
S: Unpin,
impl<S> UnwindSafe for ListenFuture<S>where
S: UnwindSafe,
Blanket Implementations§
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