Module message

Module message 

Source
Expand description

Message envelope types for exactly-once processing.

This module provides types for wrapping stream items with unique identifiers and metadata, enabling features like deduplication, offset tracking, and exactly-once processing guarantees.

§Overview

The core types are:

§Example

use streamweave::message::{Message, MessageId, MessageMetadata, IdGenerator, UuidGenerator};

// Create a message with a UUID
let generator = UuidGenerator::new();
let msg = Message::new(42, generator.next_id());

assert_eq!(*msg.payload(), 42);

Structs§

ContentHashGenerator
Content-hash ID generator.
Message
A message envelope that wraps a payload with an ID and metadata.
MessageMetadata
Metadata associated with a message.
SequenceGenerator
Sequence-based ID generator.
UuidGenerator
UUID-based ID generator.

Enums§

MessageId
A unique identifier for messages.

Traits§

IdGenerator
Trait for types that generate message IDs.

Functions§

sequence_generator
Create a shared sequence generator.
sequence_generator_from
Create a shared sequence generator starting at the given value.
uuid_generator
Create a shared UUID generator.

Type Aliases§

SharedIdGenerator
A shared ID generator that can be cloned across threads.