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::RecipientAddress 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: RecipientAddress,
<P::Addr as RecipientAddress>::Established<P>: Send,
P::Msg: Send,
impl<P> ActionItem for EstablishedDelivery<P>where
P: Protocol,
P::Addr: RecipientAddress,
<P::Addr as RecipientAddress>::Established<P>: Send,
P::Msg: Send,
type Custody = (Option<EstablishedDelivery<P>>, Option<<EstablishedDelivery<P> as ActionItem>::Reply>)
type Input<'a> = &'a mut Option<EstablishedDelivery<P>> where Self: 'a
type Reply = ItemSettlement<EstablishedDelivery<P>, <EstablishedDelivery<P> as ActionItem>::Accepted, <EstablishedDelivery<P> as ActionItem>::Rejection, <EstablishedDelivery<P> as ActionItem>::Prerequisite>
type Accepted = ()
type Rejection = ExactDeliveryReason
type Prerequisite = Never
fn prepare_interpretation( progress: &mut Option<InterpretationProgress<Self, Self::Custody, Self::Reply>>, )
fn interpretation_input<'a>(
custody: &'a mut Self::Custody,
) -> Option<(Self::Input<'a>, &'a mut Option<Self::Reply>)>where
Self: 'a,
fn finish_interpretation( progress: &mut Option<InterpretationProgress<Self, Self::Custody, Self::Reply>>, )
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>
Source§impl<P> PartialEq for EstablishedDelivery<P>where
P: Protocol,
P::Addr: RecipientAddress,
EstablishedRecipient<P>: PartialEq,
P::Msg: PartialEq,
impl<P> PartialEq for EstablishedDelivery<P>where
P: Protocol,
P::Addr: RecipientAddress,
EstablishedRecipient<P>: PartialEq,
P::Msg: PartialEq,
impl<P> Eq for EstablishedDelivery<P>
Auto Trait Implementations§
impl<P> Freeze for EstablishedDelivery<P>
impl<P> RefUnwindSafe for EstablishedDelivery<P>where
<P as Protocol>::Addr: Sized,
<P as Protocol>::Msg: RefUnwindSafe,
<<P as Protocol>::Addr as RecipientAddress>::Established<P>: 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,
<P as Protocol>::Msg: UnsafeUnpin,
<<P as Protocol>::Addr as RecipientAddress>::Established<P>: UnsafeUnpin,
impl<P> UnwindSafe for EstablishedDelivery<P>where
<P as Protocol>::Addr: Sized,
<P as Protocol>::Msg: UnwindSafe,
<<P as Protocol>::Addr as RecipientAddress>::Established<P>: 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