Move files around, add UI

This commit is contained in:
Michael Mikovsky
2025-06-05 16:02:28 -06:00
parent 8adfc68854
commit 92c9f08a5c
35 changed files with 541 additions and 132 deletions
+29
View File
@@ -0,0 +1,29 @@
/// This is the lowset-level data transmission type
pub trait Connection: Send + Sync {
type Error: std::fmt::Debug;
fn read(&mut self) -> Result<String, Self::Error>;
fn write(&mut self, data: &str) -> Result<(), Self::Error>;
}
pub trait ServerTrait<C: Connection> {
type Error: std::fmt::Debug;
fn accept(&mut self) -> Result<C, Self::Error>;
fn bind(address: &str) -> Result<Self, Self::Error>
where
Self: Sized;
}
pub trait ClientTrait<C: Connection> {
type Error: std::fmt::Debug;
fn connect(address: &str) -> Result<C, Self::Error>;
}
mod tcp;
pub use tcp::TCPClient;
pub use tcp::TCPConnection;
pub use tcp::TCPServer;