/// Stores the text of any validation errors that have occurred since /// the last call to `get_and_reset`. /// /// Each value is a validation error and a message associated with it, /// or `None` if the error has no message from the api. /// /// This is used for internal wgpu testing only and _must not_ be used /// as a way to check for errors. /// /// This works as a static because `cargo nextest` runs all of our /// tests in separate processes, so each test gets its own canary. /// /// This prevents the issue of one validation error terminating the /// entire process. pubstatic VALIDATION_CANARY: ValidationCanary = ValidationCanary {
inner: Mutex::new(Vec::new()),
};
/// Flag for internal testing. pubstruct ValidationCanary {
inner: Mutex<Vec<String>>,
}
impl ValidationCanary { #[allow(dead_code, reason = "in some configurations this function is dead")] pub(crate) fn add(&self, msg: String) { self.inner.lock().push(msg);
}
/// Returns any API validation errors that have occurred in this process /// since the last call to this function. pubfn get_and_reset(&self) -> Vec<String> { self.inner.lock().drain(..).collect()
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet am 2026-08-27)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.