Utility library for creating integrations against the Data Diode Middleware.
use tokio_ddmw::ClntIfCodec;
async fn conn_handler(
socket: TcpStream
) -> Result<(), Error> {
let mut conn = Framed::new(socket, ClntIfCodec::new());
while let Some(o) = conn.next().await {
let o = o?;
match o {
Input::Msg(msg) => {
match msg.get_topic() {
Some(t) if t == "Ok" => {
if let Some(name) = msg.get_param("Id") {
// ...
}
Some(t) if t == "Fail" => {
// ...
}
}
_ => {
// ...
}
}
Input::Bin(d, remain) => {
// ...
}
}
}
}
}