Added comms::Result

This commit is contained in:
Zachary Sunforge
2024-06-27 12:25:35 -07:00
parent 63d97b4b3b
commit b5695fe6f5
2 changed files with 7 additions and 3 deletions

View File

@ -9,7 +9,7 @@ members = [
] ]
[workspace.package] [workspace.package]
version = "0.3.2" version = "0.3.3"
edition = "2021" edition = "2021"
repository = "https://git.bfpower.io/BFPOWER/physical" repository = "https://git.bfpower.io/BFPOWER/physical"
readme = "README.md" readme = "README.md"

View File

@ -1,11 +1,15 @@
//! These abstractions are only for persistent connections (never intended to end)!
pub trait Sender { pub trait Sender {
async fn send(&mut self, msg: &[u8]) -> Result<(), Reset>; async fn send(&mut self, msg: &[u8]) -> self::Result;
} }
pub trait Receiver { pub trait Receiver {
async fn receive(&mut self, buffer: &mut [u8]) -> Result<(), Reset>; async fn receive(&mut self, buffer: &mut [u8]) -> self::Result;
} }
pub type Result = core::result::Result<Never, Reset>;
//TODO: Replace with ! //TODO: Replace with !
pub struct Never; pub struct Never;