pub struct FakeWire(/* private fields */);Expand description
The tests’ wire: records each open and close; the test feeds a call’s
sink with FakeWire::feed.
Implementations§
Source§impl FakeWire
impl FakeWire
pub fn new() -> Self
Sourcepub fn last_of(&self, method: &str) -> CallId
pub fn last_of(&self, method: &str) -> CallId
The latest call of method; panics naming it when none was opened.
Sourcepub fn feed(&self, call: CallId, item: WireItem)
pub fn feed(&self, call: CallId, item: WireItem)
Hands item to call’s sink (nothing, once it is closed). The sink
runs outside the wire’s borrow, so it may open or close calls.
Sourcepub fn answer(&self, call: CallId, events: impl IntoIterator<Item = Value>)
pub fn answer(&self, call: CallId, events: impl IntoIterator<Item = Value>)
Hands each data event to call’s sink, then Done.
Sourcepub fn drop_socket(&self)
pub fn drop_socket(&self)
Drops the socket: every open call hears Dropped.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for FakeWire
impl !Send for FakeWire
impl !Sync for FakeWire
impl !UnwindSafe for FakeWire
impl Forget for FakeWire
impl Freeze for FakeWire
impl Unpin for FakeWire
impl UnsafeUnpin for FakeWire
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Variant for T
impl<T> Variant for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert this
Variant trait object to &mut dyn Any.Source§fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Convert this
Variant trait object to Box<dyn Any>.