pub struct EnrichedEvent<T> {
pub registration_id: Option<u64>,
pub speaker_ip: IpAddr,
pub service: Service,
pub event_source: EventSource,
pub timestamp: SystemTime,
pub event_data: T,
}Expand description
An enriched event that includes context and source information
Fields§
§registration_id: Option<u64>Registration ID this event belongs to (for sonos-stream integration)
speaker_ip: IpAddrIP address of the speaker that generated this event
service: ServiceUPnP service that generated this event
event_source: EventSourceSource of this event (UPnP notification or polling)
timestamp: SystemTimeTimestamp when this event was processed
event_data: TThe actual service-specific event data
Implementations§
Source§impl<T> EnrichedEvent<T>
impl<T> EnrichedEvent<T>
Sourcepub fn new(
speaker_ip: IpAddr,
service: Service,
event_source: EventSource,
event_data: T,
) -> Self
pub fn new( speaker_ip: IpAddr, service: Service, event_source: EventSource, event_data: T, ) -> Self
Create a new enriched event
Sourcepub fn with_registration_id(
registration_id: u64,
speaker_ip: IpAddr,
service: Service,
event_source: EventSource,
event_data: T,
) -> Self
pub fn with_registration_id( registration_id: u64, speaker_ip: IpAddr, service: Service, event_source: EventSource, event_data: T, ) -> Self
Create a new enriched event with registration ID (for sonos-stream integration)
Sourcepub fn map<U, F>(self, f: F) -> EnrichedEvent<U>where
F: FnOnce(T) -> U,
pub fn map<U, F>(self, f: F) -> EnrichedEvent<U>where
F: FnOnce(T) -> U,
Map the event data to a different type
Trait Implementations§
Source§impl<T: Clone> Clone for EnrichedEvent<T>
impl<T: Clone> Clone for EnrichedEvent<T>
Source§fn clone(&self) -> EnrichedEvent<T>
fn clone(&self) -> EnrichedEvent<T>
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 moreAuto Trait Implementations§
impl<T> Freeze for EnrichedEvent<T>where
T: Freeze,
impl<T> RefUnwindSafe for EnrichedEvent<T>where
T: RefUnwindSafe,
impl<T> Send for EnrichedEvent<T>where
T: Send,
impl<T> Sync for EnrichedEvent<T>where
T: Sync,
impl<T> Unpin for EnrichedEvent<T>where
T: Unpin,
impl<T> UnsafeUnpin for EnrichedEvent<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for EnrichedEvent<T>where
T: 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