pub struct ComponentEvent {
pub event_id: String,
pub source: String,
pub target: Option<String>,
pub event_type: String,
pub data: HashMap<String, String>,
pub timestamp: SystemTime,
pub priority: EventPriority,
pub metadata: EventMetadata,
}Expand description
Component event for inter-component communication
Fields§
§event_id: StringUnique event identifier
source: StringSource component identifier
target: Option<String>Target component (optional, if None broadcasts to all subscribers)
event_type: StringEvent type identifier
data: HashMap<String, String>Event data payload
timestamp: SystemTimeEvent timestamp
priority: EventPriorityEvent priority level
metadata: EventMetadataEvent metadata
Implementations§
Source§impl ComponentEvent
impl ComponentEvent
Sourcepub fn with_target(self, target: &str) -> Self
pub fn with_target(self, target: &str) -> Self
Set target component
Sourcepub fn with_priority(self, priority: EventPriority) -> Self
pub fn with_priority(self, priority: EventPriority) -> Self
Set event priority
Sourcepub fn with_metadata(self, key: &str, value: &str) -> Self
pub fn with_metadata(self, key: &str, value: &str) -> Self
Add metadata to the event
Trait Implementations§
Source§impl Clone for ComponentEvent
impl Clone for ComponentEvent
Source§fn clone(&self) -> ComponentEvent
fn clone(&self) -> ComponentEvent
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 ComponentEvent
impl Debug for ComponentEvent
Source§impl<'de> Deserialize<'de> for ComponentEvent
impl<'de> Deserialize<'de> for ComponentEvent
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
Auto Trait Implementations§
impl Freeze for ComponentEvent
impl RefUnwindSafe for ComponentEvent
impl Send for ComponentEvent
impl Sync for ComponentEvent
impl Unpin for ComponentEvent
impl UnwindSafe for ComponentEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more