pub struct Validation;Expand description
Global validation controller.
Port provenance: oa::Validation.
Implementations§
Source§impl Validation
impl Validation
Sourcepub fn is_enabled() -> bool
pub fn is_enabled() -> bool
Return true when the validation layer is enabled.
Sourcepub fn init_from_env()
pub fn init_from_env()
Read OA_VK_VALIDATION and OA_VALIDATION_SEVERITY from the process
environment and apply them. Call once at engine init.
Sourcepub fn set_min_severity(sev: ValidationSeverity)
pub fn set_min_severity(sev: ValidationSeverity)
Override the minimum severity for emitting messages. Default: Verbose
in debug, Warning in release.
Sourcepub fn get_min_severity() -> ValidationSeverity
pub fn get_min_severity() -> ValidationSeverity
Return the current minimum severity.
Sourcepub fn set_callback(cb: Option<ValidationCallback>)
pub fn set_callback(cb: Option<ValidationCallback>)
Set an optional custom callback; None restores the default stderr
writer.
Sourcepub fn report(
sev: ValidationSeverity,
component: &str,
message: &str,
) -> Result<()>
pub fn report( sev: ValidationSeverity, component: &str, message: &str, ) -> Result<()>
Emit a validation message. Returns Err on Error or Fatal
severity; Ok otherwise.
Called by oa_validate! when the condition fails.
Sourcepub fn incr_counter(name: &str)
pub fn incr_counter(name: &str)
Increment a named debug counter (no-op in release builds).
Sourcepub fn get_counter(name: &str) -> u64
pub fn get_counter(name: &str) -> u64
Return the current value of a named debug counter (0 in release builds).
Sourcepub fn reset_counters()
pub fn reset_counters()
Reset all debug counters to zero (no-op in release builds).