pub struct InMemoryTransport;Expand description
Factory namespace for in-memory replication transports.
InMemoryTransport is a zero-sized type whose associated functions
build InMemoryEndpoint / InMemoryGroup instances. See the
module-level docs for the full topology table
and design rationale.
Implementations§
Source§impl InMemoryTransport
impl InMemoryTransport
Sourcepub fn new_pair() -> (InMemoryEndpoint, InMemoryEndpoint)
pub fn new_pair() -> (InMemoryEndpoint, InMemoryEndpoint)
Create a single bidirectional pair of cross-connected in-memory endpoints.
Sends on a arrive at b’s receive queue and vice versa.
Equivalent to LocalChannelPair::new but returned as
production-named InMemoryEndpoint handles.
Sourcepub fn new_group(n: usize) -> InMemoryGroup
pub fn new_group(n: usize) -> InMemoryGroup
Create an n-node fully-connected in-memory group.
The returned InMemoryGroup owns n · (n - 1) directional
channels arranged so that group.channel(i, j).send(msg) is
observed by group.channel(j, i).receive(...).
§Panics
Panics if n == 0. A 1-node “group” is supported (degenerate)
but a zero-node group is meaningless and almost certainly a
caller bug.
Auto Trait Implementations§
impl Freeze for InMemoryTransport
impl RefUnwindSafe for InMemoryTransport
impl Send for InMemoryTransport
impl Sync for InMemoryTransport
impl Unpin for InMemoryTransport
impl UnsafeUnpin for InMemoryTransport
impl UnwindSafe for InMemoryTransport
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
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>
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>
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