[][src]Module xtra::prelude

Commonly used types from xtra

Re-exports

pub use crate::Actor;
pub use crate::Handler;
pub use crate::Message;
pub use crate::SyncHandler;

Structs

Address

An Address is a reference to an actor through which Messages can be sent. It can be cloned, and when all Addresses are dropped, the actor will be stopped. Therefore, any existing Addresses will inhibit the dropping of an actor. If this is undesirable, then the WeakAddress struct should be used instead. This struct is created by calling the Actor::create or Actor::spawn methods.

Context

Context is used to control how the actor is managed and to get the actor's address from inside of a message handler.

MessageChannel

A message channel is a channel through which you can send only one kind of message, but to any actor that can handle it. It is like Address, but associated with the message type rather than the actor type. Any existing MessageChannels will prevent the dropping of the actor. If this is undesirable, then the WeakMessageChannel struct should be used instead. This struct is created by calling Address::channel, Address::into_channel, or the similar methods on WeakAddress.

Traits

AddressExt

General trait for any kind of address to an actor, be it strong or weak. This trait contains all functions of the address.

MessageChannelExt

General trait for any kind of channel of messages, be it strong or weak. This trait contains all functions of the channel.