Skip to main content

Crate eventuary_core

Crate eventuary_core 

Source
Expand description

Core event model and async IO traits for the eventuary toolkit.

This crate provides the typed event model (Event, Payload, Topic, Namespace, OrganizationId), serialization helpers (SerializedEvent), and async IO traits for backends (io::Reader, io::Writer, io::Handler, io::Acker).

Most consumers should depend on the eventuary umbrella crate and pick backends via Cargo features, instead of using eventuary-core directly. Use this crate when you are implementing a new backend or want only the core types without any backend.

§Example

use eventuary_core::{Event, Payload};

let event = Event::builder(
    "acme",
    "/billing",
    "invoice.created",
    "invoice-123",
    Payload::from_json(&serde_json::json!({"amount": 100})).unwrap(),
).unwrap()
.build().unwrap();
assert_eq!(event.topic().as_str(), "invoice.created");

Re-exports§

pub use partition::HasPartition;
pub use partition::Partition;
pub use io::filter::NamespacePattern;
pub use io::filter::TopicPattern;
pub use io::position::PartitionableSubscription;
pub use io::position::StartFrom;
pub use io::position::StartableSubscription;
pub use io::position::StopAt;

Modules§

io
partition

Structs§

Context
ContextError
Event
EventCollector
EventId
EventKey
FieldMap
JsonPayloadCodec
Metadata
Namespace
OrganizationId
Payload
PayloadEventCodec
PayloadPassthroughCodec
SerializedEvent
Wire-format representation of an Event. Field order matches Event so the JSON shape is predictable and self-documenting.
Topic

Enums§

ContentType
ContextValue
Error
SerializedPayload
Wire-format representation of a Payload.

Traits§

EventCodec
PayloadCodec
Snapshot
SnapshotEventId

Type Aliases§

Result