nyquest_interface/
blocking.rs

1//! Blocking HTTP client interface.
2//!
3//! This module provides the interfaces and types necessary for blocking
4//! HTTP client implementations in nyquest.
5
6mod any;
7mod backend;
8
9pub use any::{AnyBlockingBackend, AnyBlockingClient, AnyBlockingResponse};
10pub use backend::{BlockingBackend, BlockingClient, BlockingResponse};
11/// Type alias for blocking HTTP requests.
12pub type Request = crate::Request<BoxedStream>;
13
14cfg_if::cfg_if! {
15    if #[cfg(feature = "blocking-stream")] {
16        use std::io::Read as MaybeRead;
17
18        mod body;
19
20        pub use body::{Body, BoxedStream, SizedBodyStream, UnsizedBodyStream};
21    } else {
22        /// Placeholder trait when blocking stream functionality is not required.
23        pub trait MaybeRead {}
24        impl<T: ?Sized> MaybeRead for T {}
25
26        type BoxedStream = std::convert::Infallible;
27        /// Type alias for common HTTP request bodies.
28        pub type Body = crate::body::Body<std::convert::Infallible>;
29    }
30}