tcp_request/response/response_binary/
impl.rs

1use crate::*;
2
3impl ResponseTrait for TcpResponseBinary {
4    type OutputText = TcpResponseText;
5    type OutputBinary = TcpResponseBinary;
6
7    #[inline]
8    fn from(response: &[u8]) -> Self
9    where
10        Self: Sized,
11    {
12        response.to_vec()
13    }
14
15    #[inline]
16    fn binary(&self) -> Self::OutputBinary {
17        self.clone()
18    }
19
20    #[inline]
21    fn text(&self) -> TcpResponseText {
22        let data: String = String::from_utf8_lossy(&self).to_string();
23        data
24    }
25}