pub struct MockAlloc { /* private fields */ }
Expand description
An alloc is a specific allocation, returned by an Allocator
.
Implementations§
Source§impl MockAlloc
impl MockAlloc
Sourcepub fn checkpoint(&mut self)
pub fn checkpoint(&mut self)
Validate that all current expectations for all methods have been satisfied, and discard them.
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new mock object with no expectations.
This method will not be generated if the real struct
already has a new
method. However, it will be
generated if the struct implements a trait with a new
method. The trait’s new
method can still be called
like <MockX as TraitY>::new
Source§impl MockAlloc
impl MockAlloc
Sourcepub fn expect_next(&mut self) -> &mut Expectation
pub fn expect_next(&mut self) -> &mut Expectation
Create an Expectation
for mocking the next
method
Sourcepub fn expect_extent(&mut self) -> &mut Expectation
pub fn expect_extent(&mut self) -> &mut Expectation
Create an Expectation
for mocking the extent
method
Sourcepub fn expect_shape(&mut self) -> &mut Expectation
pub fn expect_shape(&mut self) -> &mut Expectation
Create an Expectation
for mocking the shape
method
Sourcepub fn expect_world_id(&mut self) -> &mut Expectation
pub fn expect_world_id(&mut self) -> &mut Expectation
Create an Expectation
for mocking the world_id
method
Sourcepub fn expect_transport(&mut self) -> &mut Expectation
pub fn expect_transport(&mut self) -> &mut Expectation
Create an Expectation
for mocking the transport
method
Sourcepub fn expect_stop(&mut self) -> &mut Expectation
pub fn expect_stop(&mut self) -> &mut Expectation
Create an Expectation
for mocking the stop
method
Sourcepub fn expect_stop_and_wait(&mut self) -> &mut Expectation
pub fn expect_stop_and_wait(&mut self) -> &mut Expectation
Create an Expectation
for mocking the stop_and_wait
method
Trait Implementations§
Source§impl Alloc for MockAlloc
An alloc is a specific allocation, returned by an Allocator
.
impl Alloc for MockAlloc
An alloc is a specific allocation, returned by an Allocator
.
Source§fn next<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Option<ProcState>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Option<ProcState>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return the next proc event. None
indicates that there are
no more events, and that the alloc is stopped.
Source§fn world_id(&self) -> &WorldId
fn world_id(&self) -> &WorldId
The world id of this alloc, uniquely identifying the alloc. Note: This will be removed in favor of a different naming scheme, once we exise “worlds” from hyperactor core.
Source§fn transport(&self) -> ChannelTransport
fn transport(&self) -> ChannelTransport
The channel transport used the procs in this alloc.
Source§fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), AllocatorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), AllocatorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stop this alloc, shutting down all of its procs. A clean shutdown should result in Stop events from all allocs, followed by the end of the event stream.
Source§fn stop_and_wait<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), AllocatorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop_and_wait<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), AllocatorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stop this alloc and wait for all procs to stop. Call will block until all ProcState events have been drained.
Auto Trait Implementations§
impl Freeze for MockAlloc
impl RefUnwindSafe for MockAlloc
impl Send for MockAlloc
impl Sync for MockAlloc
impl Unpin for MockAlloc
impl UnwindSafe for MockAlloc
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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