pub trait LogicalDeliveryProtocols: SendEffects {
type Protocols: BirthProtocolProduct;
}Expand description
Static projection of intentional logical destinations from one concrete sends product.
Implementations mirror the product’s InterpretSends traversal without
inspecting values. Only Delivery<P> contributes P; exact established
deliveries, creator-local child deliveries and inputs, and interpreter
requests contribute nothing. Named products append their field projections
in interpretation order, preserving repeated protocol occurrences.
Custom named sends products must implement this trait explicitly. There is
deliberately no blanket Vec<T> implementation that could silently treat
an unknown delivery representation as having no logical destination.
use behavior::{
Actions, Behavior, BehaviorActed, LogicalHostRequirements, MailAddr,
Never, NoBirths, Protocol, SendEffects, User,
};
struct OpaqueSends;
impl SendEffects for OpaqueSends {
fn empty() -> Self { Self }
fn append(&mut self, _: Self) {}
}
impl<E> behavior::SendsFor<E> for OpaqueSends {}
struct Actor;
impl Protocol for Actor { type Addr = MailAddr; type Msg = (); }
impl Behavior for Actor {
type Protocol = Self;
type Event = User<MailAddr, ()>;
type Sends = OpaqueSends;
type Ph = Never;
type Error = Never;
type Birth = NoBirths;
fn transition(&mut self, _: behavior::ActiveTurn, _: Self::Event)
-> BehaviorActed<Self> { Ok(Actions::cont()) }
}
fn require_complete<B: LogicalHostRequirements>() {}
require_complete::<Actor>();Required Associated Types§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".