pub struct EstablishedDelivery<P>{
pub to: EstablishedRecipient<P>,
pub message: P::Msg,
}Expand description
One pure communication to an exact installed incarnation.
Unlike Delivery, this effect carries the runtime-issued endpoint and
requires no address-to-endpoint resolution. Constructing it remains pure;
only an explicit crate::InterpretItem implementation for this exact
delivery type can
perform the communication.
Exact endpoints remain protocol-indexed even when two protocols share an address namespace and message type:
ⓘ
#[derive(Clone, Copy, PartialEq, Eq)]
struct RuntimeAddr(u64);
impl behavior::Address for RuntimeAddr { type Nonce = u64; }
struct Endpoint<P>(core::marker::PhantomData<fn() -> P>);
impl<P> Clone for Endpoint<P> {
fn clone(&self) -> Self { Self(core::marker::PhantomData) }
}
impl behavior::EndpointAddress for RuntimeAddr {
type Established<P> = Endpoint<P> where P: behavior::Protocol<Addr = Self>;
}
struct Queue;
struct Worker;
impl behavior::Protocol for Queue { type Addr = RuntimeAddr; type Msg = u8; }
impl behavior::Protocol for Worker { type Addr = RuntimeAddr; type Msg = u8; }
let worker = behavior::EstablishedRecipient::<Worker>::issued(Endpoint(core::marker::PhantomData));
let _: behavior::EstablishedDelivery<Queue> = behavior::EstablishedDelivery::new(worker, 7);Fields§
§to: EstablishedRecipient<P>§message: P::MsgImplementations§
Source§impl<P> EstablishedDelivery<P>
impl<P> EstablishedDelivery<P>
pub const fn new(to: EstablishedRecipient<P>, message: P::Msg) -> Self
Trait Implementations§
Source§impl<P> ActionItem for EstablishedDelivery<P>where
P: Protocol,
P::Addr: EndpointAddress,
<P::Addr as EndpointAddress>::Established<P>: Send,
P::Msg: Send,
impl<P> ActionItem for EstablishedDelivery<P>where
P: Protocol,
P::Addr: EndpointAddress,
<P::Addr as EndpointAddress>::Established<P>: Send,
P::Msg: Send,
Source§impl<P> Clone for EstablishedDelivery<P>
impl<P> Clone for EstablishedDelivery<P>
Source§impl<P> Debug for EstablishedDelivery<P>
impl<P> Debug for EstablishedDelivery<P>
impl<P> Eq for EstablishedDelivery<P>
Source§impl<P> PartialEq for EstablishedDelivery<P>
impl<P> PartialEq for EstablishedDelivery<P>
Auto Trait Implementations§
impl<P> Freeze for EstablishedDelivery<P>
impl<P> RefUnwindSafe for EstablishedDelivery<P>where
<P as Protocol>::Addr: Sized,
EstablishedRecipient<P>: RefUnwindSafe,
<P as Protocol>::Msg: RefUnwindSafe,
impl<P> Send for EstablishedDelivery<P>
impl<P> Sync for EstablishedDelivery<P>
impl<P> Unpin for EstablishedDelivery<P>
impl<P> UnsafeUnpin for EstablishedDelivery<P>where
<P as Protocol>::Addr: Sized,
EstablishedRecipient<P>: UnsafeUnpin,
<P as Protocol>::Msg: UnsafeUnpin,
impl<P> UnwindSafe for EstablishedDelivery<P>where
<P as Protocol>::Addr: Sized,
EstablishedRecipient<P>: UnwindSafe,
<P as Protocol>::Msg: UnwindSafe,
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