tcp_request/response/response_text/
impl.rs1use super::r#type::TcpResponseText;
2use crate::response::{r#trait::ResponseTrait, response_binary::r#type::TcpResponseBinary};
3
4impl ResponseTrait for TcpResponseText {
5 type OutputText = TcpResponseText;
6 type OutputBinary = TcpResponseBinary;
7
8 #[inline]
9 fn from(response: &[u8]) -> Self::OutputText
10 where
11 Self: Sized,
12 {
13 <TcpResponseBinary as ResponseTrait>::from(response).text()
14 }
15
16 #[inline]
17 fn text(&self) -> Self::OutputText {
18 self.clone()
19 }
20
21 #[inline]
22 fn binary(&self) -> TcpResponseBinary {
23 self.clone().into_bytes()
24 }
25}