pub fn valid<T>(device: &Device, callback: impl FnOnce() -> T) -> T
Run some code in an error scope and assert that validation succeeds.