A Rust library for sending raw TCP requests, with features for handling responses, managing redirects, and working with compressed data over TCP connections.
usecrate::*;/// ResponseTrait implementation for binary TCP responses.
implResponseTrait forTcpResponseBinary{typeOutputText= TcpResponseText;typeOutputBinary= TcpResponseBinary;/// Creates a binary response from raw bytes.
////// # Arguments
////// - `&[u8]` - The raw response data.
////// # Returns
////// - `Self` - A new binary response instance.
#[inline(always)]fnfrom(response:&[u8])->SelfwhereSelf: Sized,
{
response.to_vec()}/// Gets the binary representation of the response.
////// # Returns
////// - `Self::OutputBinary` - The binary response data.
#[inline(always)]fnbinary(&self)->Self::OutputBinary{self.clone()}/// Converts the binary response to text representation.
////// # Returns
////// - `TcpResponseText` - The text representation of the response.
#[inline(always)]fntext(&self)-> TcpResponseText{let data:String=String::from_utf8_lossy(self).to_string();
data
}}