pub trait DeliveryRoute: DeliveryRoute + Sized {
type Protocol: Protocol;
type Sends: SendEffects;
// Required method
fn deliver(self, message: <Self::Protocol as Protocol>::Msg) -> Self::Sends;
}Expand description
A statically selected transferable destination capability.
The associated protocol prevents actor templates from repeating a separate protocol parameter beside the route that already determines it. Logical and established routes select different concrete send products without weakening either capability.
The owner’s address namespace is stated through the associated protocol:
R: DeliveryRoute<Protocol: Protocol<Addr = BehaviorAddr<Owner>>>.
A route for another protocol cannot be substituted merely because its
payload has the same Rust type:
type Expected = behavior::MessageProtocol<behavior::MailAddr, u8>;
struct Other;
impl behavior::Protocol for Other {
type Addr = behavior::MailAddr;
type Msg = u8;
}
fn require_expected<R: behavior_actors::DeliveryRoute<Protocol = Expected>>(_: R) {}
require_expected(behavior::Recipient::<Other>::global(behavior::MailAddr(1)));Creator-local child routes require the owning actor’s birth algebra and cannot be substituted for a transferable acquaintance. There is one route interface for these transferable capabilities:
fn require<Owner, Route>()
where
Owner: behavior::Behavior,
Route: behavior_actors::DeliveryRouteFor<Owner>,
{}Required Associated Types§
Sourcetype Sends: SendEffects
type Sends: SendEffects
The concrete sends product produced by this route.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.