pub struct Mocker<K> { /* private fields */ }
Expand description
Mocker for a block
A harness to run a block without a runtime. Used for unit tests and benchmarking.
Implementations§
source§impl<K: Kernel + 'static> Mocker<K>
impl<K: Kernel + 'static> Mocker<K>
sourcepub fn new(block: TypedBlock<K>) -> Self
pub fn new(block: TypedBlock<K>) -> Self
Create mocker
sourcepub fn input<T>(&mut self, id: usize, data: Vec<T>)where
T: Debug + Send + 'static,
pub fn input<T>(&mut self, id: usize, data: Vec<T>)where T: Debug + Send + 'static,
Add input buffer with given data
Add input buffer with given data and tags
sourcepub fn init_output<T>(&mut self, id: usize, size: usize)where
T: Debug + Send + 'static,
pub fn init_output<T>(&mut self, id: usize, size: usize)where T: Debug + Send + 'static,
Initialize output buffer with given size
Auto Trait Implementations§
impl<K> !RefUnwindSafe for Mocker<K>
impl<K> Send for Mocker<K>where K: Send,
impl<K> !Sync for Mocker<K>
impl<K> Unpin for Mocker<K>where K: Unpin,
impl<K> !UnwindSafe for Mocker<K>
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