pub struct Event<L> {
pub time: SystemTime,
pub episode: Uuid,
pub payload: L,
}Expand description
Something an actor wanted written down, stamped with when it said so and which episode it was in. The payload is whatever the episode’s actors log, most often their message type.
Fields§
§time: SystemTimeWhen the event was logged.
episode: UuidThe episode it was logged in.
payload: LWhat the actor logged.
Implementations§
Source§impl<L: Serialize> Event<L>
impl<L: Serialize> Event<L>
Sourcepub fn write<W: Write>(&self, sink: W) -> Result<()>
pub fn write<W: Write>(&self, sink: W) -> Result<()>
Write this event to sink as one line of JSON. Nothing is
summarized: the line carries the whole event, with its time as
seconds and nanoseconds since the Unix epoch.
§Errors
Fails when writing to sink fails, or when the event cannot be
serialized, as one stamped before the epoch cannot.
Trait Implementations§
Source§impl<'de, L> Deserialize<'de> for Event<L>where
L: Deserialize<'de>,
impl<'de, L> Deserialize<'de> for Event<L>where
L: Deserialize<'de>,
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
impl<L: PartialEq> StructuralPartialEq for Event<L>
Auto Trait Implementations§
impl<L> Freeze for Event<L>where
L: Freeze,
impl<L> RefUnwindSafe for Event<L>where
L: RefUnwindSafe,
impl<L> Send for Event<L>where
L: Send,
impl<L> Sync for Event<L>where
L: Sync,
impl<L> Unpin for Event<L>where
L: Unpin,
impl<L> UnsafeUnpin for Event<L>where
L: UnsafeUnpin,
impl<L> UnwindSafe for Event<L>where
L: 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