musli/context/
error_marker.rsuse core::fmt;
#[derive(Debug)]
#[non_exhaustive]
pub struct ErrorMarker;
impl fmt::Display for ErrorMarker {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "Error during encoding or decoding (see context)")
}
}
impl core::error::Error for ErrorMarker {}
#[cfg(test)]
impl crate::context::ContextError for ErrorMarker {
#[inline]
fn custom<T>(_: T) -> Self
where
T: 'static + Send + Sync + fmt::Display + fmt::Debug,
{
ErrorMarker
}
#[inline]
fn message<T>(_: T) -> Self
where
T: fmt::Display,
{
ErrorMarker
}
}