use stdcore::fmt::{
Debug,
Display,
Formatter,
};
use crate::core::*;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum CoreAtom<Stream, Error = <Stream as Streaming>::Error> {
EndOfStream {
stream: Stream,
},
Error {
error: Error,
},
}
impl<Stream: Streaming> Display for CoreAtom<Stream>
where
Stream: Debug,
Stream::Error: Debug,
{
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
match self {
Self::EndOfStream { .. } => write!(f, "End of stream"),
Self::Error { error } => write!(f, "The stream have encounter an error {:?}", error,),
}
}
}