Repository navigation
Release v0.8.0
Added - 0.8.0
-
Runtime-agnostic async support (
asyncfeature)-
New
async_extmodule with core async types -
FutureResultExttrait providing.ctx()and.with_ctx()methods onFuture<Output = Result<T, E>> -
ContextFuturewrapper for lazy error context evaluation (cancel-safe) -
AsyncErrorPipelinefor chainable async error handling operations -
prelude_asyncmodule re-exporting all prelude items plus async-specific functionality -
rail_async!macro for wrapping async operations intoAsyncErrorPipeline -
ctx_async!macro for attaching formatted context to futures ergonomically -
Added
docs/QUICK_START_ASYNC.mdwith async usage patterns and best practices
-
-
Async validation support (
asyncfeature)-
validate_all_async<I>function for running multiple async validations sequentially and accumulating all errors -
validate_seq_asyncfunction for sequential validation where each step depends on previous result -
Runtime-neutral design mirroring synchronous
Validationsemantics
-
-
Async retry support (
asyncfeature)-
RetryPolicytrait for pluggable retry strategies -
ExponentialBackoffpolicy with builder pattern (with_initial_delay,with_max_delay,with_max_attempts,with_multiplier) -
FixedDelaypolicy for constant-delay retries -
retry_with_policyfunction: runtime-agnostic retry loop accepting customsleep_fn -
retry_with_metadatafunction returningRetryResult<T, E>withresult,attempts, andtotal_wait_time -
Structured context on failure (e.g., "exhausted N retry attempts", "permanent error, no retry")
-
-
Tokio integration (
tokiofeature)-
retry_transientconvenience function usingtokio::time::sleep -
retry_transient_nfor simple retry with attempt count -
try_with_timeoutwrapper returningTimeoutResult<T, E> -
TimeoutResultenum withOk,Err, andTimeoutvariants -
TimeoutErrortype for timeout representation
-
-
Tower integration (
towerfeature)-
ErrorRailLayer: TowerLayerwrapping service errors inComposableErrorwith context -
ErrorRailService: TowerServicewrapper for error context attachment -
ErrorRailFuture: Future wrapper for lazy context evaluation -
ServiceErrorExttrait providing.with_error_context()extension for anyService
-
-
Tracing integration (
tracingfeature)-
FutureSpanExttrait providing.with_span_context()and.with_span()for futures -
ResultSpanExttrait providing.with_current_span()and.with_span()for Results -
SpanContextFuture: Future wrapper capturing span context on error -
instrument_errorfunction to add current span context to any error
-
-
Feature flag layout
-
tokio,tower, andtracingfeatures are independently configurable -
ecosystemis a convenience bundle enablingtokio+tower+tracing
-
-
Comprehensive test coverage for async functionality
-
tests/async_ext/future_ext_tests.rs: lazy evaluation and context chaining -
tests/async_ext/pipeline_tests.rs: AsyncErrorPipeline operations -
tests/async_ext/validation_tests.rs: all-valid, some-invalid, and sequential validation scenarios -
tests/async_ext/retry_tests.rs: transient/permanent errors and exhausted attempts -
tests/async_ext/tokio_tests.rs: Tokio-specific retry and timeout functionality -
tests/async_ext/tracing_tests.rs: span context attachment
-
-
New examples
-
examples/async_api_patterns.rs: demonstrates 7 common async error handling patterns -
examples/async_tower_integration.rs: demonstrates Tower layer and service usage
-