pub enum LogicalDeliveryReason {
UnknownAddress,
ClosedRecipient,
}Expand description
One pure communication addressed to a concrete protocol signature.
Protocol identity is not inferred from the payload. Consequently, two protocols with the same address and message types still have distinct delivery types.
ⓘ
struct Queue;
struct Worker;
impl behavior::Protocol for Queue {
type Addr = behavior::MailAddr;
type Msg = u8;
}
impl behavior::Protocol for Worker {
type Addr = behavior::MailAddr;
type Msg = u8;
}
let worker = behavior::Recipient::<Worker>::global(behavior::MailAddr(1));
let _: behavior::Delivery<Queue> = behavior::Delivery::new(worker, 7);A destination also fixes its message and address namespaces:
ⓘ
#[derive(Clone, Copy, PartialEq, Eq)]
struct OtherAddr(u64);
impl behavior::Address for OtherAddr {
type Nonce = u64;
}
struct Worker;
impl behavior::Protocol for Worker {
type Addr = behavior::MailAddr;
type Msg = u8;
}
let _ = behavior::Recipient::<Worker>::global(OtherAddr(1));ⓘ
let worker = behavior::Recipient::<Worker>::global(behavior::MailAddr(1));
let _ = behavior::Delivery::<Worker>::new(worker, "wrong payload");Exact reason one logical delivery was not accepted.
Variants§
Trait Implementations§
Source§impl Clone for LogicalDeliveryReason
impl Clone for LogicalDeliveryReason
Source§fn clone(&self) -> LogicalDeliveryReason
fn clone(&self) -> LogicalDeliveryReason
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LogicalDeliveryReason
impl Debug for LogicalDeliveryReason
Source§impl PartialEq for LogicalDeliveryReason
impl PartialEq for LogicalDeliveryReason
impl Copy for LogicalDeliveryReason
impl Eq for LogicalDeliveryReason
impl StructuralPartialEq for LogicalDeliveryReason
Auto Trait Implementations§
impl Freeze for LogicalDeliveryReason
impl RefUnwindSafe for LogicalDeliveryReason
impl Send for LogicalDeliveryReason
impl Sync for LogicalDeliveryReason
impl Unpin for LogicalDeliveryReason
impl UnsafeUnpin for LogicalDeliveryReason
impl UnwindSafe for LogicalDeliveryReason
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