Skip to main content

nautilus_actor

Macro nautilus_actor 

Source
macro_rules! nautilus_actor {
    ($ty:ty) => { ... };
    ($ty:ty, $field:ident) => { ... };
}
Expand description

Implements Deref<Target = DataActorCore> and DerefMut for an actor type.

The struct must contain a field that dereferences to DataActorCore, either directly or through an intermediate type (e.g. ExecutionAlgorithmCore). By default the macro expects the field to be named core; pass a second argument to use a different name.

§Examples

use nautilus_common::{nautilus_actor, actor::DataActorCore};

pub struct MyActor {
    core: DataActorCore,
    // ...
}

nautilus_actor!(MyActor);

With a custom field name:

pub struct MyActor {
    actor_core: DataActorCore,
    // ...
}

nautilus_actor!(MyActor, actor_core);