pub struct FsActor {}Trait Implementations§
Source§impl Actor for FsActor
impl Actor for FsActor
Source§fn max_anonymous_actors() -> usize
fn max_anonymous_actors() -> usize
Declare the maximum amount of anonymous actors that a parent actor can
spawn. If the maximum amount of anonymous actors are executing, then pause
the actor until there is space to spawn another.
Source§fn mailbox_size() -> usize
fn mailbox_size() -> usize
The max size of the actors mailbox. The actor will only be able to store
a max of the number provided. After the mailbox is full, it will stop
accepting new message or apply back pressure and the sender will need to
wait for items to be removed from the mailbox.
Source§fn on_start(&mut self, _: &mut Ctx<Self>)where
Self: Actor,
fn on_start(&mut self, _: &mut Ctx<Self>)where
Self: Actor,
Called before transitioning to an [
ActorState::Started] state. Good usage is to load data
from a database or disk.Source§fn pre_run(&mut self, _: &mut Ctx<Self>)
fn pre_run(&mut self, _: &mut Ctx<Self>)
Called right before the handler for the message. Basically before the actors
state transitions from a [
ActorState::Started] to a [ActorState::Running].
Good usage is to cache data that can not be lost!Source§fn post_run(&mut self, _: &mut Ctx<Self>)
fn post_run(&mut self, _: &mut Ctx<Self>)
Called after the handler for any message has been called. Is called before
actor state transitions from a [
ActorState::Running] to a [ActorState::Started].
Good usage is logging.Source§fn on_stopping(&mut self, _: &mut Ctx<Self>)
fn on_stopping(&mut self, _: &mut Ctx<Self>)
Called after transitioning to an [
ActorState::Stopping] state. Mainly
used to communicate with all child actors that the actor will be shutting
down shortly and that they should also finish executing.Source§fn on_stopped(&mut self, _: &mut Ctx<Self>)
fn on_stopped(&mut self, _: &mut Ctx<Self>)
Called after transitioning to an [
ActorState::Stopped] state. Even when
this state is reached there could be messages left inside of the mailbox.
Users should save an actors data during the Actor::on_end state transition.Auto Trait Implementations§
impl Freeze for FsActor
impl RefUnwindSafe for FsActor
impl Send for FsActor
impl Sync for FsActor
impl Unpin for FsActor
impl UnwindSafe for FsActor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more