#![allow(deprecated)]
use crate::{extract::Extract, AgentId, Event, StateChange, TryExtract};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[deprecated(since = "0.9.0", note = "replaced by agent marker event")]
pub struct TagEvent {
pub time: u64,
pub agent: AgentId,
pub tag: i32,
}
impl Extract for TagEvent {
#[inline]
unsafe fn extract(event: &Event) -> Self {
Self {
time: event.time,
agent: AgentId::from_src(event),
tag: event.value,
}
}
}
impl TryExtract for TagEvent {
#[inline]
fn can_extract(event: &Event) -> bool {
event.get_statechange() == StateChange::Marker
}
}