mirror of
https://github.com/Astatin3/unshell.git
synced 2026-06-09 06:47:59 -06:00
Better static runtime config, work on connections.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
mod connection;
|
||||
|
||||
pub use connection::Connection;
|
||||
|
||||
use crate::ModuleError;
|
||||
|
||||
/// This is the data transmission type
|
||||
pub trait Stream<T>: Send + Sync {
|
||||
// fn get_info(&self) -> String;
|
||||
fn is_alive(&self) -> bool;
|
||||
|
||||
fn len(&self) -> usize;
|
||||
fn read(&mut self) -> Option<T>;
|
||||
|
||||
fn write(&mut self, data: T) -> Result<(), ModuleError>;
|
||||
|
||||
fn try_clone(&self) -> Result<Box<dyn Stream<T> + Send + Sync>, ModuleError>;
|
||||
}
|
||||
Reference in New Issue
Block a user