Skip to main content

canon

Function canon 

Source
fn canon(v: &Value) -> String
Expand description

The text an attribute of this value would have been indexed under.

This is the contract between AttrPred and the block index, and both sides are written against it: Op::Eq on a stored string is defined as equality with this text, and crate::attrs::index writes exactly these bytes for the str, int and bool types. Doubles are not in the index at all — the numeric flag covers them — so a stored double is reached through HAS_DOUBLE rather than through this string.

Every value has a text form, including a fractional double: nothing forces a producer to send 0.5 as a double rather than as "0.5", and returning None here to mean “unindexable” made every fractional-double equality scan every block.