vyre 0.4.0

GPU compute intermediate representation with a standard operation library
Documentation
//! Validation error type for vyre IR programs.

use core::fmt;
use std::borrow::Cow;

/// A validation error in a vyre Program.
#[non_exhaustive]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ValidationError {
    /// What is wrong.
    pub message: Cow<'static, str>,
}

impl ValidationError {
    /// Error message.
    #[must_use]
    #[inline]
    pub fn message(&self) -> &str {
        &self.message
    }
}

impl fmt::Display for ValidationError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "vyre IR validation: {}", self.message)
    }
}