Skip to main content

Crate use_event_envelope

Crate use_event_envelope 

Source
Expand description

§use-event-envelope

Generic event envelope composed from RustUse event primitives.

§Install

[dependencies]
use-event-envelope = "0.1.0"

§Example

use use_event_envelope::EventEnvelope;
use use_event_kind::EventKind;
use use_event_name::EventName;
use use_event_source::EventSource;

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");

§Scope

  • Compose event id, name, kind, source, target, timestamp, metadata, and caller-owned payload values.
  • Provide builder-style helpers for caller-supplied ids, targets, metadata, and timestamps.
  • Use EventId::default() in new because v0.1.0 intentionally does not generate identifiers.

§Non-Goals

  • No UUID generation.
  • No serialization or persistence.
  • No dispatch, queue, broker, scheduler, or runtime behavior.

§Status

Experimental v0.1.0 primitive.

§License

Licensed under either of the following, at your option:

  • Apache License, Version 2.0
  • MIT license

Structs§

EventEnvelope