mirror of
https://github.com/Astatin3/unshell.git
synced 2026-06-08 22:38:01 -06:00
19 lines
431 B
Rust
19 lines
431 B
Rust
|
|
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>;
|
||
|
|
}
|