[−][src]Struct seal_rs::actors::actor_cell::ActorCell
Fields
dispatcher: TSafe<dyn Dispatcher + Send>
Reference to the message dispatcher
mailbox: TSafe<dyn Mailbox + Send>
Actor mailbox
bid: u32
Executor asynchronous block id. Actually this value represents the thread id, on the actor messages will processed. See default_dispatcher for more info about actor's async mechanics.
actor: TSafe<dyn Actor + Send>
Object which extends the actor trait and contain application logic
path: TSafe<ActorPath>
Actor path object that represents the actor position in the actors hierarchy
system: TSafe<ActorSystem>
Reference to the actor system
suspended: bool
Suspend flag. See the suspend method description for more details
stopped: bool
Stop flag. See the start method description for more details
Methods
impl ActorCell
[src]
pub fn new(
system: TSafe<ActorSystem>,
path: TSafe<ActorPath>,
actor: TSafe<dyn Actor + Send>,
bid: u32,
dispatcher: TSafe<dyn Dispatcher + Send>,
mailbox: TSafe<dyn Mailbox + Send>
) -> ActorCell
[src]
system: TSafe<ActorSystem>,
path: TSafe<ActorPath>,
actor: TSafe<dyn Actor + Send>,
bid: u32,
dispatcher: TSafe<dyn Dispatcher + Send>,
mailbox: TSafe<dyn Mailbox + Send>
) -> ActorCell
Create new actor cell. This is the internal constructor and should never be used in a user code.
pub fn start(&mut self, boxed_self: TSafe<ActorCell>)
[src]
Starts the actor. Creates him context, obtain bid form the dispatcher, run preStart hook and permits message receiving through dropping the stopped flag.
pub fn stop(&mut self, boxed_self: TSafe<ActorCell>)
[src]
Stops the actor. Prohibits receiving new messages and calls the postStop hook.
pub fn suspend(&mut self)
[src]
Suspends the actor. Prohibits receiving new messages.
pub fn send(
&mut self,
boxed_self: &TSafe<ActorCell>,
msg: Box<dyn Any + Send + 'static>,
rself: Option<ActorRef>,
to_ref: ActorRef
)
[src]
&mut self,
boxed_self: &TSafe<ActorCell>,
msg: Box<dyn Any + Send + 'static>,
rself: Option<ActorRef>,
to_ref: ActorRef
)
Sends the message to the actor. Creates new envelope with the message and indicates to dispatcher to schedule execution of this envelope. Message sends to the actors may be done, only if flags suspended and stopped will be dropped. Otherwise, the message will be dropped to deadLetter.
pub fn force_send(
&mut self,
boxed_self: TSafe<ActorCell>,
msg: Box<dyn Any + Send + 'static>,
rself: Option<ActorRef>,
to_ref: ActorRef
)
[src]
&mut self,
boxed_self: TSafe<ActorCell>,
msg: Box<dyn Any + Send + 'static>,
rself: Option<ActorRef>,
to_ref: ActorRef
)
Performs action identical to the send method do, but with ignoring state of the stopping flags.
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,