1mod listener;
7pub use listener::SctpListener;
8
9mod socket;
10pub use socket::*;
11
12mod stream;
13pub use stream::*;
14
15mod split_owned;
16pub use split_owned::*;
17
18mod sys;
19
20use std::io;
21
22fn wrap_io_error(desc: &'static str, e: io::Error) -> io::Error {
23 io::Error::new(e.kind(), WrappedIoErr(desc, e))
24}
25
26struct WrappedIoErr(&'static str, io::Error);
27
28impl std::fmt::Display for WrappedIoErr {
29 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
30 write!(f, "{:?}", self)
31 }
32}
33
34impl std::fmt::Debug for WrappedIoErr {
35 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
36 write!(f, "{}: {:?}", self.0, self.1)
37 }
38}
39
40impl std::error::Error for WrappedIoErr {
41 fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
42 Some(&self.1)
43 }
44}