pub type InvariantsFnTyped<T> = fn(&T) -> bool;
Function to validate the invariants of a value. If it returns false, the value is considered invalid.