use core::fmt::Debug;
use core::marker::PhantomData;
pub struct Field<Tag, Value> {
pub value: Value,
pub phantom: PhantomData<Tag>,
}
impl<Tag, Value> From<Value> for Field<Tag, Value> {
fn from(value: Value) -> Self {
Self {
value,
phantom: PhantomData,
}
}
}
impl<Tag, Value> Debug for Field<Tag, Value>
where
Value: Debug,
{
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
self.value.fmt(f)
}
}
impl<Tag, Value> PartialEq for Field<Tag, Value>
where
Value: PartialEq,
{
fn eq(&self, other: &Self) -> bool {
self.value.eq(&other.value)
}
}
impl<Tag, Value> Eq for Field<Tag, Value> where Value: Eq {}