#[create]
Expand description
This marks a function as the method that should be used to create the actor. It emits a method
which returns a tuple of the address to the actor and its ActorManager
.
Arguments
This macro can be passed what to rename the method in the form of rename = "{new name}"
.
This is most useful when generating both a create and spawn method from the same constructor.
Usage
ⓘ
#[spaad::create]
fn create(some: Thing) -> MyActor {
MyActor { some }
}
#[spaad::create(rename = "something_else")] // Emits a method called `something_else`
fn create2(some: Thing) -> MyActor {
MyActor { some }
}