flows-http 0.0.6

Building blocks for flow-based HTTP requests & responses.
Documentation
// This is free and unencumbered software released into the public domain.

use alloc::boxed::Box;
use core::error::Error as StdError;
use thiserror::Error;

pub type Result<T = (), E = Error> = core::result::Result<T, E>;

#[derive(Debug, Error)]
pub enum Error {
    #[error("missing URL scheme")]
    MissingUrlScheme,

    #[error("missing URL host")]
    MissingUrlHost,

    #[cfg(feature = "std")]
    #[error("TCP connection failed: {0}")]
    TcpConnectFailed(std::io::Error),

    #[error("HTTP handshake failed: {0}")]
    HttpHandshakeFailed(hyper::Error),

    #[error("HTTP request failed: {0}")]
    HttpRequestFailed(#[from] hyper::Error),

    #[cfg(feature = "std")]
    #[error("I/O failed: {0}")]
    StdioFailed(#[from] std::io::Error),

    #[error("unknown error: {0}")]
    Other(#[from] Box<dyn StdError + Send + Sync>),
}