Skip to content

std.derived

Implementations written once for any record whose fields already have them: derive eq for Point;, derive ord for Point;, derive hash for Point;.

// Field-wise equality.
pub recipe eq for R

// Lexicographic order over the fields, in declaration order.
pub recipe ord for R

// FNV-1a over the fields' own hashes.
pub recipe hash for R

A generic function's effects are what it may do for any arguments within its bounds, besides what their own trait members do.