Struct tonari_actor::timed::Timed
source · 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>
§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>
.§type Message = TimedMessage<M>
type Message = TimedMessage<M>
The expected type of a message to be received.
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§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 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)
fn started(&mut self, context: &mut Self::Context)
An optional callback when the Actor has been started.
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