#![feature(yggdrasil_os, rustc_private, let_chains)]

use std::io::{self};

pub mod netconfig;
pub mod proto;

// pub use proto::http::HttpClient;

#[derive(thiserror::Error, Debug)]
pub enum Error {
    #[error("I/O error: {0}")]
    IoError(#[from] io::Error),
    #[error("NetConfig returned error: {0}")]
    NetConfError(Box<str>),
    #[error("{0:?}")]
    RtError(std::os::yggdrasil::rt::Error),
    #[error("Serialize/deserialize error: {0}")]
    SerializeError(#[from] serde_json::Error),
    #[error("Timed out")]
    TimedOut,
    #[error("TOML deserialize error: {0}")]
    TomlDeserializeErr(#[from] toml::de::Error),
    #[error("Cannot resolve network address: {0:?}")]
    UnresolvedAddress(String),
}

