pub struct SimLoopback { /* private fields */ }Expand description
TestTransport backed by a SimNetwork: an in-memory drop-in for
HttpLoopback. Build a cluster over it with
Cluster::builder().transport(Arc::new(SimLoopback::new(net.clone()))) and
keep net to drive partitions.
Implementations§
Source§impl SimLoopback
impl SimLoopback
Sourcepub fn new(network: SimNetwork) -> Self
pub fn new(network: SimNetwork) -> Self
Wrap a SimNetwork. Share one network across the cluster (clone the
handle) so the test and every peer route through the same fabric.
Trait Implementations§
Source§impl TestTransport for SimLoopback
impl TestTransport for SimLoopback
Source§fn serve<'life0, 'life1, 'async_trait>(
&'life0 self,
sync: &'life1 Sync,
) -> Pin<Box<dyn Future<Output = Result<Address>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn serve<'life0, 'life1, 'async_trait>(
&'life0 self,
sync: &'life1 Sync,
) -> Pin<Box<dyn Future<Output = Result<Address>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Register this transport on
sync, start serving, and return the address
other peers use to reach it. Called once per peer at build time.Auto Trait Implementations§
impl Freeze for SimLoopback
impl RefUnwindSafe for SimLoopback
impl Send for SimLoopback
impl Sync for SimLoopback
impl Unpin for SimLoopback
impl UnsafeUnpin for SimLoopback
impl UnwindSafe for SimLoopback
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
§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