Files
orchid/orchid-api-traits/src/relations.rs
Lawrence Bethlenfalvy bc3b10674b Separated orchid-host and orchid-extension
This is an architectural change that allows me to implment specifics first and generalize along observed symmetries in orchid-base
2024-05-01 21:20:17 +02:00

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