1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use std::error::Error as StdError;
use std::fmt;
pub mod connector;
pub mod streams;
#[derive(Debug)]
pub struct IoError(pub String);
impl IoError {
pub fn new<T: Into<String>>(s: T) -> Self {
Self(s.into())
}
}
impl fmt::Display for IoError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.0)?;
Ok(())
}
}
impl StdError for IoError {
fn source(&self) -> Option<&(dyn StdError + 'static)> {
None
}
}