|
@@ -113,6 +113,29 @@ impl Active { |
|
|
event_attr!(id, Uuid, id); |
|
|
event_attr!(id, Uuid, id); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
impl From<Event<Pending>> for Active { |
|
|
|
|
|
fn from(pending: Event<Pending>) -> Active { |
|
|
|
|
|
Active::Pending(pending) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
macro_rules! from_event { |
|
|
|
|
|
($t:ty, $variant:ident) => { |
|
|
|
|
|
impl From<Event<$t>> for Active { |
|
|
|
|
|
fn from(event: Event<$t>) -> Active { |
|
|
|
|
|
Active::$variant(event) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//from_event!(Pending, Pending); |
|
|
|
|
|
from_event!(Sending, Sending); |
|
|
|
|
|
from_event!(Sent, Sent); |
|
|
|
|
|
from_event!(Ack, Acked); |
|
|
|
|
|
from_event!(Finished<Sent>, FinishedNoAck); |
|
|
|
|
|
|
|
|
#[allow(unused)] |
|
|
#[allow(unused)] |
|
|
#[cfg(test)] |
|
|
#[cfg(test)] |
|
|
mod tests { |
|
|
mod tests { |
|
|