use std::fmt::Debug;
use std::fmt::Formatter;
use std::fmt::Result;
#[derive(Clone, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[non_exhaustive]
pub enum PathSegment {
Field(
&'static str,
),
Index(
usize,
),
MapEntry(
usize,
),
MapKey,
MapValue,
}
impl Debug for PathSegment {
fn fmt(&self, formatter: &mut Formatter<'_>) -> Result {
match self {
Self::Field(_) => formatter.write_str("Field(<redacted>)"),
Self::Index(index) => formatter.debug_tuple("Index").field(index).finish(),
Self::MapEntry(index) => formatter.debug_tuple("MapEntry").field(index).finish(),
Self::MapKey => formatter.write_str("MapKey"),
Self::MapValue => formatter.write_str("MapValue"),
}
}
}