This is an architectural change that allows me to implment specifics first and generalize along observed symmetries in orchid-base
17 lines
392 B
Rust
17 lines
392 B
Rust
use super::coding::{Coding, Encode};
|
|
|
|
pub trait Request: Coding + Sized + Send + 'static {
|
|
type Response: Coding + Send + 'static;
|
|
fn respond(&self, rep: Self::Response) -> Vec<u8> { rep.enc_vec() }
|
|
}
|
|
|
|
pub trait Channel: 'static {
|
|
type Req: Coding + Sized + Send + 'static;
|
|
type Notif: Coding + Sized + Send + 'static;
|
|
}
|
|
|
|
pub trait MsgSet {
|
|
type In: Channel;
|
|
type Out: Channel;
|
|
}
|