pub struct FixtureTransport { /* private fields */ }Expand description
In-memory skill transport for tests and examples.
Each registered operation maps to a FixtureBehavior; calls are counted
so tests can assert on dispatch.
Implementations§
Source§impl FixtureTransport
impl FixtureTransport
Sourcepub fn new(id: impl Into<String>) -> Self
pub fn new(id: impl Into<String>) -> Self
Creates an empty fixture transport with the given id.
Sourcepub fn insert(
&self,
operation: impl Into<String>,
behavior: FixtureBehavior,
) -> Result<()>
pub fn insert( &self, operation: impl Into<String>, behavior: FixtureBehavior, ) -> Result<()>
Registers behavior for operation, replacing any existing handler.
Sourcepub fn call_count(&self) -> usize
pub fn call_count(&self) -> usize
Returns the number of calls dispatched through this transport.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FixtureTransport
impl RefUnwindSafe for FixtureTransport
impl Send for FixtureTransport
impl Sync for FixtureTransport
impl Unpin for FixtureTransport
impl UnsafeUnpin for FixtureTransport
impl UnwindSafe for FixtureTransport
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