intrepid_model/
events.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
mod event;
mod event_connection;
mod event_kind;
mod event_record;
mod event_repo;
mod event_traits;

pub use event::Event;
pub use event_connection::EventConnection;
pub use event_kind::EventKind;
pub use event_record::EventRecord;
pub use event_repo::{EventRepo, EventRepoError};
pub use event_traits::IntoEvent;

/// Convenience type for a vec of events
pub type PendingEvents = Vec<Event>;

/// Convenience type for a vec of event records
pub type EventLog = Vec<EventRecord>;

impl From<Event> for EventLog {
    fn from(event: Event) -> Self {
        vec![EventRecord::from(event).set_position(1)]
    }
}