pub struct Envelope<E> { /* private fields */ }Expand description
The unit carried through all Maiko channels.
Every event in the system travels as Arc<Envelope<E>> - from producer
through the broker to each subscriber’s mailbox. It pairs the user-defined
event payload with Meta (sender, timestamp, parent ID).
Implementations§
Source§impl<E> Envelope<E>
impl<E> Envelope<E>
Sourcepub fn new(event: E, actor_id: ActorId) -> Self
pub fn new(event: E, actor_id: ActorId) -> Self
Create a new envelope tagging the event with the given actor name.
Sourcepub fn with_parent_id(self, parent_id: EventId) -> Self
pub fn with_parent_id(self, parent_id: EventId) -> Self
Set the parent event ID for causality tracking.
Prefer Context::send_child_event which
sets this automatically. Use with_parent_id directly only when constructing
envelopes outside the normal actor context (e.g., in test setup or bridges).
Trait Implementations§
Source§impl<'de, E> Deserialize<'de> for Envelope<E>where
E: DeserializeOwned,
impl<'de, E> Deserialize<'de> for Envelope<E>where
E: DeserializeOwned,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<E> From<Envelope<E>> for IntoEnvelope<E>
impl<E> From<Envelope<E>> for IntoEnvelope<E>
impl<E: Eq> Eq for Envelope<E>
Auto Trait Implementations§
impl<E> Freeze for Envelope<E>where
E: Freeze,
impl<E> RefUnwindSafe for Envelope<E>where
E: RefUnwindSafe,
impl<E> Send for Envelope<E>where
E: Send,
impl<E> Sync for Envelope<E>where
E: Sync,
impl<E> Unpin for Envelope<E>where
E: Unpin,
impl<E> UnsafeUnpin for Envelope<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for Envelope<E>where
E: 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