tcp_request/response/
trait.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::fmt::Debug;

pub trait ResponseTrait: Send + Debug {
    type OutputText: Clone + Sized;
    type OutputBinary: Clone + Sized;

    fn text(&self) -> Self::OutputText;

    fn binary(&self) -> Self::OutputBinary;

    fn from(response: &[u8]) -> Self
    where
        Self: Sized;
}