Skip to main content

Module combinator

Module combinator 

Source
Expand description

The combinator module provides a set of combinators for building complex DurationSampler instances from simpler ones.

These combinators allow for fluent, declarative construction of sampling logic, including mapping, delaying, jittering, chaining, aggregating, clamping, and ensuring non-negative durations.

Structs§

AggregateBuilder
A builder for constructing an AggregateSampler in a fluent manner.
AggregateSampler
A sampler that aggregates results from multiple sub-samplers using a closure.
ChainSampler
A sampler that chains two sub-samplers together, combining their results using a closure.
ClampSampler
A sampler that clamps the sampled value within the specified [min, max] range.
DelaySampler
A sampler that delays the output of a base sampler by adding the value from a delay sampler.
EnsureNonNegativeSampler
A sampler that ensures the sampled duration is non-negative.
JitterSampler
A sampler that applies “jitter” (noise) to the output of a base sampler.
MapSampler
A sampler that maps the output of a base sampler to a new value using a closure.