use std::io;
use zruntime::LocalRuntime;
#[cfg(doc)]
use zruntime::SharedRuntime;
mod stream;
pub use stream::{Connection, ReadHalf, Stream, WriteHalf, connect, connect_local};
#[cfg(feature = "server")]
mod listener;
#[cfg(feature = "server")]
pub use listener::{Listener, bind, bind_local};
fn running_local() -> io::Result<LocalRuntime> {
LocalRuntime::running().ok_or_else(|| {
io::Error::other(
"no local runtime is running on this thread: make the socket from inside \
`LocalRuntime::block_on`, or from a task of that runtime",
)
})
}