use std::fmt;
use super::Request;
use crate::client::ClientOptions;
use crate::Result;
pub trait BlockingClient: Clone + Send + Sync + 'static {
type Response: BlockingResponse;
fn describe(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "BlockingClient")
}
fn request(&self, req: Request) -> crate::Result<Self::Response>;
}
pub trait BlockingBackend: Send + Sync + 'static {
type BlockingClient: BlockingClient;
fn create_blocking_client(&self, options: ClientOptions) -> Result<Self::BlockingClient>;
}
pub trait BlockingResponse: super::MaybeRead + Send + Sync + 'static {
fn describe(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "BlockingResponse")
}
fn status(&self) -> u16;
fn content_length(&self) -> Option<u64>;
fn get_header(&self, header: &str) -> crate::Result<Vec<String>>;
fn text(&mut self) -> crate::Result<String>;
fn bytes(&mut self) -> crate::Result<Vec<u8>>;
}