Skip to main content

Validation

Struct Validation 

Source
pub struct Validation;
Expand description

Global validation controller.

Port provenance: oa::Validation.

Implementations§

Source§

impl Validation

Source

pub fn enable(on: bool)

Enable or disable the validation layer globally.

Source

pub fn is_enabled() -> bool

Return true when the validation layer is enabled.

Source

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.

Source

pub fn set_min_severity(sev: ValidationSeverity)

Override the minimum severity for emitting messages. Default: Verbose in debug, Warning in release.

Source

pub fn get_min_severity() -> ValidationSeverity

Return the current minimum severity.

Source

pub fn set_callback(cb: Option<ValidationCallback>)

Set an optional custom callback; None restores the default stderr writer.

Source

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.

Source

pub fn incr_counter(name: &str)

Increment a named debug counter (no-op in release builds).

Source

pub fn get_counter(name: &str) -> u64

Return the current value of a named debug counter (0 in release builds).

Source

pub fn reset_counters()

Reset all debug counters to zero (no-op in release builds).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.