Skip to main content

sample_value

Function sample_value 

Source
pub fn sample_value(ty: &Type, name: &str) -> Value
Expand description

A deterministic, type-valid sample value (used by orbit simulate for tasks without a mock). name is the field the value is for.

TypeSample
String"<name>-sample"
Int1
Float1.0
Booltrue
Bytes"c2FtcGxl" (base64 of sample)
Duration1000 (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
recordevery field: its default, else a sample