pub struct Register { /* private fields */ }Expand description
An general record of running actors
when an actor get into running,
A record will registered into Register for future
usage (Create/Read/Update/Delete)
and the registered ActorRegister will be removed
when the actor is closed
Implementations§
source§impl Register
impl Register
sourcepub fn new() -> &'static Self
pub fn new() -> &'static Self
create an instance of Register
sourcepub fn push<A: Actor>(item: ActorRegister) -> ActorGuard<A>
pub fn push<A: Actor>(item: ActorRegister) -> ActorGuard<A>
push an actor into REGISTER and return its guarded underlying actor
sourcepub fn get(id: usize) -> Option<&'static ActorRegister>
pub fn get(id: usize) -> Option<&'static ActorRegister>
get an actor register by id
sourcepub fn as_ref() -> &'static Vec<ActorRegister>
pub fn as_ref() -> &'static Vec<ActorRegister>
take the reference of Register