Skip to main content

Module facts

Module facts 

Source
Expand description

Fact values and conversion to and from Rust types.

Modules§

serde_time
Serde support for time fields in fact structs. Annotate DateTime fields with #[serde(with = "rust_runes::serde_time")] (or serde_time::option for Option<DateTime<_>>) and Fact::from_serialize turns them into time values that rules can compare and pass to the time functions. Without it, chrono serializes times as strings, and they reach rules as strings.

Structs§

Fact
A named value rules can refer to, e.g. Ride in Ride.Distance > 5000.

Enums§

FactValue
A value rules can read and write. Integers and floats are distinct, as in Grule: integer literals and arithmetic stay integers, and / always produces a float.