pub fn sample_value(ty: &Type, name: &str) -> ValueExpand description
A deterministic, type-valid sample value (used by orbit simulate for
tasks without a mock). name is the field the value is for.
| Type | Sample |
|---|---|
String | "<name>-sample" |
Int | 1 |
Float | 1.0 |
Bool | true |
Bytes | "c2FtcGxl" (base64 of sample) |
Duration | 1000 (one second) |
Timestamp | "2026-01-01T00:00:00Z" |
UUID | "00000000-0000-4000-8000-000000000001" |
JSON | {} |
List<T> | one sample element |
Map<String, T> | { "key": <sample T> } |
T? | null |
| record | every field: its default, else a sample |