mirror of
https://github.com/Noratrieb/terustform.git
synced 2026-01-14 08:30:13 +01:00
26 lines
500 B
Rust
26 lines
500 B
Rust
#![allow(dead_code)]
|
|
|
|
pub mod datasource;
|
|
pub mod provider;
|
|
|
|
use self::datasource::DataSource;
|
|
|
|
pub struct Diagnostics {
|
|
pub(crate) errors: Vec<String>,
|
|
}
|
|
|
|
pub type DResult<T> = Result<T, Diagnostics>;
|
|
|
|
impl Diagnostics {
|
|
pub fn error_string(msg: String) -> Self {
|
|
Self {
|
|
errors: vec![msg],
|
|
}
|
|
}
|
|
}
|
|
|
|
impl<E: std::error::Error + std::fmt::Debug> From<E> for Diagnostics {
|
|
fn from(value: E) -> Self {
|
|
Self::error_string(format!("{:?}", value))
|
|
}
|
|
}
|