Refactor FFI bindings

This commit is contained in:
Jackson Coxson
2025-05-26 12:52:23 -06:00
parent 15261861e0
commit fa88c2c87d
22 changed files with 1005 additions and 1476 deletions

View File

@@ -31,6 +31,17 @@ impl<'a> AdapterStream<'a> {
pub async fn close(&mut self) -> Result<(), std::io::Error> {
self.adapter.close(self.host_port).await
}
/// Sends data to the target
pub async fn psh(&mut self, payload: &[u8]) -> Result<(), std::io::Error> {
self.adapter.queue_send(payload, self.host_port)?;
self.adapter.write_buffer_flush().await?;
Ok(())
}
pub async fn recv(&mut self) -> Result<Vec<u8>, std::io::Error> {
self.adapter.recv(self.host_port).await
}
}
impl AsyncRead for AdapterStream<'_> {