use std::fmt::{self, Display};
use serde::{Deserialize, Serialize};
#[enser::enser]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum External<V> {
Tbd,
Value(V),
}
impl<V> Display for External<V>
where
V: Clone + Display,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let type_name = tynm::type_name::<V>();
match self {
Self::Tbd => write!(f, "{type_name} not yet determined"),
Self::Value(v) => write!(f, "{type_name}: {v}"),
}
}
}
pub type Generated<V> = External<V>;
pub type Fetched<V> = External<V>;
pub type Timestamped<V> = External<V>;