/* * File: TODO.rs * Brief: TODO * * Copyright (C) TODO John Jekel * See the LICENSE file at the root of the project for licensing info. * * TODO longer description * */ /*! * TODO rustdoc for this file here */ /* ------------------------------------------------------------------------------------------------ * Submodules * --------------------------------------------------------------------------------------------- */ //TODO (includes "mod ..." and "pub mod ...") /* ------------------------------------------------------------------------------------------------ * Uses * --------------------------------------------------------------------------------------------- */ use std::fmt; use std::fmt::Display; /* ------------------------------------------------------------------------------------------------ * Macros * --------------------------------------------------------------------------------------------- */ //TODO (also pub(crate) use the_macro statements here too) /* ------------------------------------------------------------------------------------------------ * Constants * --------------------------------------------------------------------------------------------- */ //TODO /* ------------------------------------------------------------------------------------------------ * Static Variables * --------------------------------------------------------------------------------------------- */ //TODO /* ------------------------------------------------------------------------------------------------ * Types * --------------------------------------------------------------------------------------------- */ #[derive(Debug)] #[non_exhaustive] pub enum Error { Unknown, //TODO others Reason { //TODO populate with what the standard provides through vpi_chk_error todo: String, }, Other(Box)//A non sv-api error } pub type Result = std::result::Result>; /* ------------------------------------------------------------------------------------------------ * Associated Functions and Methods * --------------------------------------------------------------------------------------------- */ //TODO /* ------------------------------------------------------------------------------------------------ * Traits And Default Implementations * --------------------------------------------------------------------------------------------- */ //TODO /* ------------------------------------------------------------------------------------------------ * Trait Implementations * --------------------------------------------------------------------------------------------- */ impl std::error::Error for Error { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { match self { Error::Other(other_boxed_error) => Some(other_boxed_error.as_ref()), _ => None } } } impl Display for Error { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> fmt::Result { match self { Error::Unknown => write!(f, "Unknown or unclassified error"), Error::Reason { todo } => write!(f, "Reason: {}", todo),//TODO display this properly Error::Other(other_boxed_error) => write!(f, "Other: {}", other_boxed_error) } } } /* ------------------------------------------------------------------------------------------------ * Functions * --------------------------------------------------------------------------------------------- */ //TODO /* ------------------------------------------------------------------------------------------------ * Tests * --------------------------------------------------------------------------------------------- */ //TODO /* ------------------------------------------------------------------------------------------------ * Benchmarks * --------------------------------------------------------------------------------------------- */ //TODO