pub struct Timed<A: Actor> { /* private fields */ }Expand description
A wrapper around actors to add ability to receive delayed and recurring messages. See module documentation for a complete recipe.
Implementations§
Trait Implementations§
Source§impl<M: Send + 'static, A: Actor<Context = TimedContext<M>, Message = M>> Actor for Timed<A>
impl<M: Send + 'static, A: Actor<Context = TimedContext<M>, Message = M>> Actor for Timed<A>
Source§const DEFAULT_CAPACITY_HIGH: usize = A::DEFAULT_CAPACITY_HIGH
const DEFAULT_CAPACITY_HIGH: usize = A::DEFAULT_CAPACITY_HIGH
Default capacity of actor’s high-priority inbox unless overridden by
.with_capacity().Source§const DEFAULT_CAPACITY_NORMAL: usize = A::DEFAULT_CAPACITY_NORMAL
const DEFAULT_CAPACITY_NORMAL: usize = A::DEFAULT_CAPACITY_NORMAL
Default capacity of actor’s normal-priority inbox unless overridden by
.with_capacity().Source§type Context = Context<<Timed<A> as Actor>::Message>
type Context = Context<<Timed<A> as Actor>::Message>
What kind of context this actor accepts. Usually
Context<Self::Message>.Source§type Message = TimedMessage<M>
type Message = TimedMessage<M>
The expected type of a message to be received.
Source§fn handle(
&mut self,
context: &mut Self::Context,
timed_message: Self::Message,
) -> Result<(), Self::Error>
fn handle( &mut self, context: &mut Self::Context, timed_message: Self::Message, ) -> Result<(), Self::Error>
The primary function of this trait, allowing an actor to handle incoming messages of a certain type.
Source§fn name() -> &'static str
fn name() -> &'static str
The name of the Actor. Used by
tonari-actor for logging/debugging.
Default implementation uses type_name().Source§fn priority(message: &Self::Message) -> Priority
fn priority(message: &Self::Message) -> Priority
Determine priority of a
message before it is sent to this actor.
Default implementation returns Priority::Normal.Source§fn started(&mut self, context: &mut Self::Context) -> Result<(), Self::Error>
fn started(&mut self, context: &mut Self::Context) -> Result<(), Self::Error>
An optional callback when the Actor has been started.
Source§fn stopped(&mut self, context: &mut Self::Context) -> Result<(), Self::Error>
fn stopped(&mut self, context: &mut Self::Context) -> Result<(), Self::Error>
An optional callback when the Actor has been stopped.
Auto Trait Implementations§
impl<A> Freeze for Timed<A>where
A: Freeze,
impl<A> !RefUnwindSafe for Timed<A>
impl<A> Send for Timed<A>where
A: Send,
impl<A> !Sync for Timed<A>
impl<A> Unpin for Timed<A>
impl<A> !UnwindSafe for Timed<A>
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