1use crate::std::fmt;
2
3#[derive(Debug)]
10pub struct Error(());
11
12impl Error {
13 #[inline(always)]
19 pub fn new() -> Self {
20 Error(())
21 }
22}
23
24impl fmt::Display for Error {
25 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
26 write!(f, "failed to stream data")
27 }
28}
29
30#[cfg(feature = "std")]
31mod std_support {
32 use super::*;
33
34 use crate::std::error;
35
36 impl error::Error for Error {}
37}
38
39#[inline(always)]
45pub fn error<T>() -> crate::Result<T> {
46 Err(Error::new())
47}