Expand description
TOML value coercion utilities.
TOML integers and floats are distinct types — 1 parses as integer, 1.0 as
float. These helpers coerce either form into Rust numeric types so callers
don’t have to repeat the as_float().or_else(|| as_integer().map(...)) dance.
Functions§
- toml_
color - Extract an RGBA color from a TOML array of 3 (alpha defaults to 1.0) or 4 numbers.
- toml_
f32 - Coerce a TOML integer or float to
f32. - toml_
f64 - Coerce a TOML integer or float to
f64. - toml_
f32_ slice - Coerce every element of a
&[Value]slice tof32. - toml_
to_ vec3 - Extract a
Vec3from a TOML value that is either an array[x, y, z]or a table{ x = .., y = .., z = .. }. - toml_
vec3 - Extract
[f32; 3]from a TOML array of 3+ numbers. - toml_
vec4 - Extract
[f32; 4]from a TOML array of 4+ numbers.