(ctl_path: &Path, ack_path: &Path)
| 113 | } |
| 114 | |
| 115 | pub fn open(ctl_path: &Path, ack_path: &Path) -> anyhow::Result<Self> { |
| 116 | create_fifo(ctl_path)?; |
| 117 | create_fifo(ack_path)?; |
| 118 | |
| 119 | let ack_fifo = open_fifo_sender(ack_path)?; |
| 120 | let ctl_fifo = open_fifo_receiver(ctl_path)?; |
| 121 | |
| 122 | let codec = LengthDelimitedCodec::builder() |
| 123 | .length_field_length(4) |
| 124 | .little_endian() |
| 125 | .new_codec(); |
| 126 | let ctl_reader = FramedRead::new(ctl_fifo, codec); |
| 127 | |
| 128 | Ok(Self { |
| 129 | ack_fifo, |
| 130 | ctl_reader, |
| 131 | }) |
| 132 | } |
| 133 | |
| 134 | pub async fn recv_cmd(&mut self) -> anyhow::Result<FifoCommand> { |
| 135 | let bytes = self |
no test coverage detected