Trait muse_reactor::WorkUnit

source ·
pub trait WorkUnit:
    Sized
    + Send
    + 'static {
    // Required method
    fn initialize(
        self,
        vms: &dyn NewVm<Self>,
        guard: &mut CollectionGuard<'_>,
        reactor: &ReactorHandle<Self>,
    ) -> Result<Vm, PrepareError>;
}
Expand description

A custom unit of work for a Reactor.

Required Methods§

source

fn initialize( self, vms: &dyn NewVm<Self>, guard: &mut CollectionGuard<'_>, reactor: &ReactorHandle<Self>, ) -> Result<Vm, PrepareError>

Initializes a new virtual machine for this unit of work.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl WorkUnit for Code

source§

fn initialize( self, vms: &dyn NewVm<Self>, guard: &mut CollectionGuard<'_>, reactor: &ReactorHandle<Self>, ) -> Result<Vm, PrepareError>

Implementors§