ads_proto/proto/proto_traits.rs
1use crate::proto::command_id::CommandID;
2use std::io::{self, Read, Write};
3
4pub trait ReadFrom: Sized {
5 fn read_from<R: Read>(read: &mut R) -> io::Result<Self>;
6}
7
8pub trait WriteTo {
9 fn write_to<W: Write>(&self, wtr: W) -> io::Result<()>;
10}
11
12pub trait Command {
13 fn command_id(&self) -> CommandID;
14}
15
16pub trait SendRecieve {
17 // TODO add router as param that implements read to write
18 fn send_receive(&self) -> io::Result<()>;
19}