use-event 0.1.0

Feature-gated facade crate for RustUse event primitives.
Documentation
use use_event::EventLog;
use use_event::{EventEnvelope, EventKind, EventName, EventSource};

fn main() {
    let event = EventEnvelope::new(
        EventName::new("command.started"),
        EventKind::Started,
        EventSource::new("cli"),
        "rustuse build",
    );

    assert_eq!(event.name.as_str(), "command.started");
    assert_eq!(event.payload, "rustuse build");

    let mut log = EventLog::new();
    log.append(EventName::new("test.started"));
    log.append(EventName::new("test.passed"));

    assert_eq!(log.len(), 2);
    assert_eq!(log.last().map(EventName::as_str), Some("test.passed"));
}