Files
unshell/unshell-lib/src/network/mod.rs
T

19 lines
431 B
Rust
Raw Normal View History

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>;
}