updated all deps

migrated away from paste and async-std
This commit is contained in:
2025-09-03 18:42:54 +02:00
parent 7031f3a7d8
commit 088cb6a247
44 changed files with 569 additions and 456 deletions

View File

@@ -1,10 +1,10 @@
use std::io;
use std::pin::Pin;
use async_std::io::{Read, ReadExt, Write, WriteExt};
use futures::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt};
use orchid_api_traits::{Decode, Encode};
pub async fn send_msg(mut write: Pin<&mut impl Write>, msg: &[u8]) -> io::Result<()> {
pub async fn send_msg(mut write: Pin<&mut impl AsyncWrite>, msg: &[u8]) -> io::Result<()> {
let mut len_buf = vec![];
u32::try_from(msg.len()).unwrap().encode(Pin::new(&mut len_buf)).await;
write.write_all(&len_buf).await?;
@@ -12,7 +12,7 @@ pub async fn send_msg(mut write: Pin<&mut impl Write>, msg: &[u8]) -> io::Result
write.flush().await
}
pub async fn recv_msg(mut read: Pin<&mut impl Read>) -> io::Result<Vec<u8>> {
pub async fn recv_msg(mut read: Pin<&mut impl AsyncRead>) -> io::Result<Vec<u8>> {
let mut len_buf = [0u8; (u32::BITS / 8) as usize];
read.read_exact(&mut len_buf).await?;
let len = u32::decode(Pin::new(&mut &len_buf[..])).await;