fluxion-core
Part of Fluxion - A reactive stream processing library for Rust
Core traits and types for ordered stream processing in async Rust.
Overview
This crate provides the foundational abstractions used throughout the Fluxion ecosystem:
Timestampedtrait: Temporal ordering for stream items via timestampsStreamItem<T>: Error-aware stream item wrapper- Lock utilities: Safe mutex operations with error propagation
Key Types
Timestamp Traits
Fluxion-core provides two traits for temporal ordering:
HasTimestamp - Read-Only Access
Minimal trait for types that expose a timestamp value:
Use this when your type only needs to provide a timestamp for ordering (most common case).
Timestamped - Full Wrapper Interface
Extends HasTimestamp with construction methods for wrapper types:
Use this for wrapper types like Sequenced<T> that wrap an inner value with a timestamp.
Sequenced
A ready-to-use implementation of Timestamped using monotonically growing sequence numbers (available in fluxion-test-utils):
use Sequenced;
use Timestamped;
let item = new;
assert_eq!;
// Timestamp uses chrono::Utc::now()
Lock Utilities
Safe mutex lock acquisition with error propagation:
use lock_or_error;
use ;
let mutex = new;
let mut guard = lock_or_error?;
guard.push;
Usage
Add this to your Cargo.toml:
[]
= "0.3.0"
License
Apache-2.0