pub struct InMemoryTransport<D> { /* private fields */ }Expand description
Deterministic in-memory adapter for coverage-contract fault campaigns.
This adapter can drop, duplicate, reorder, partition, and heal links. It is useful for CI and demos; it is not a real radio/network adapter.
Implementations§
Source§impl<D> InMemoryTransport<D>
impl<D> InMemoryTransport<D>
pub fn new() -> Self
pub fn drop_next_send(&mut self)
pub fn duplicate_next_send(&mut self)
pub fn reverse_pending_for(&mut self, peer: u64)
pub fn pending_len(&self) -> usize
pub fn dropped_len(&self) -> usize
Trait Implementations§
Source§impl<D: Clone> Clone for InMemoryTransport<D>
impl<D: Clone> Clone for InMemoryTransport<D>
Source§fn clone(&self) -> InMemoryTransport<D>
fn clone(&self) -> InMemoryTransport<D>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<D: Debug> Debug for InMemoryTransport<D>
impl<D: Debug> Debug for InMemoryTransport<D>
Source§impl<D> Default for InMemoryTransport<D>
impl<D> Default for InMemoryTransport<D>
impl<D: Eq> Eq for InMemoryTransport<D>
Source§impl<D: PartialEq> PartialEq for InMemoryTransport<D>
impl<D: PartialEq> PartialEq for InMemoryTransport<D>
Source§fn eq(&self, other: &InMemoryTransport<D>) -> bool
fn eq(&self, other: &InMemoryTransport<D>) -> bool
Tests for
self and other values to be equal, and is used by ==.1.0.0 (const: unstable) · Source§fn ne(&self, other: &Rhs) -> bool
fn ne(&self, other: &Rhs) -> bool
Tests for
!=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.impl<D: PartialEq> StructuralPartialEq for InMemoryTransport<D>
Source§impl<D: Clone> TransportAdapter<D> for InMemoryTransport<D>
impl<D: Clone> TransportAdapter<D> for InMemoryTransport<D>
fn subscribe(&mut self, peer: u64)
fn is_subscribed(&self, peer: u64) -> bool
fn set_connected(&mut self, a: u64, b: u64, connected: bool)
fn is_connected(&self, a: u64, b: u64) -> bool
fn send( &mut self, from: u64, to: u64, records: Vec<Record<D>>, ) -> Result<(), TransportError>
fn drain(&mut self, peer: u64) -> Vec<TransportEnvelope<D>>
Auto Trait Implementations§
impl<D> Freeze for InMemoryTransport<D>
impl<D> RefUnwindSafe for InMemoryTransport<D>where
D: RefUnwindSafe,
impl<D> Send for InMemoryTransport<D>where
D: Send,
impl<D> Sync for InMemoryTransport<D>where
D: Sync,
impl<D> Unpin for InMemoryTransport<D>where
D: Unpin,
impl<D> UnsafeUnpin for InMemoryTransport<D>
impl<D> UnwindSafe for InMemoryTransport<D>where
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
Source§fn type_id(&self) -> TypeId
fn type_id(&self) -> TypeId
Gets the
TypeId of self. Read moreSource§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
Source§fn borrow(&self) -> &T
fn borrow(&self) -> &T
Immutably borrows from an owned value. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Performs copy-assignment from
self to dest. Read moreSource§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
Source§fn into(self) -> U
fn into(self) -> U
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.