`deserialize` returns `Constraints`, so I think it makes sense that `serialize` should take `Constraints` rather than a `View`.