Trait Alloc

Source
pub trait Alloc {
    // Required methods
    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 extent(&self) -> &Extent;
    fn world_id(&self) -> &WorldId;
    fn transport(&self) -> ChannelTransport;
    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;

    // Provided methods
    fn shape(&self) -> Shape { ... }
    fn stop_and_wait<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), AllocatorError>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

An alloc is a specific allocation, returned by an Allocator.

Required Methods§

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,

Return the next proc event. None indicates that there are no more events, and that the alloc is stopped.

Source

fn extent(&self) -> &Extent

The shape of the alloc.

Source

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

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,

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.

Provided Methods§

Source

fn shape(&self) -> Shape

The shape of the alloc. (Deprecated.)

Source

fn stop_and_wait<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), AllocatorError>> + Send + 'async_trait>>
where Self: Send + '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.

Implementors§

Source§

impl Alloc for LocalAlloc

Source§

impl Alloc for ProcessAlloc

Source§

impl Alloc for RemoteProcessAlloc

Source§

impl Alloc for SimAlloc

Source§

impl Alloc for MockAlloc

An alloc is a specific allocation, returned by an Allocator.

Source§

impl Alloc for MockAllocWrapper